3 use DBIx::Class::Fixtures;
4 use Test::More tests => 7;
11 # set up and populate normal schema
12 ok(my $schema = DBICTest->init_schema(), 'got schema');
13 my $config_dir = 't/var/configs';
15 my @different_connection_details = (
16 'dbi:SQLite:t/var/DBIxClassDifferent.db',
21 my $schema2 = DBICTest::Schema2->compose_namespace('DBICTest2')
22 ->connect(@different_connection_details);
26 unlink('t/var/DBIxClassDifferent.db') if (-e 't/var/DBIxClassDifferent.db');
28 DBICTest->deploy_schema($schema2, 't/lib/sqlite_different.sql');
31 ok(my $fixtures = DBIx::Class::Fixtures->new({
32 config_dir => $config_dir,
35 'object created with correct config dir');
38 config => "simple.json",
40 directory => 't/var/fixtures'
42 "simple dump executed okay");
44 ok($fixtures->populate({
45 ddl => 't/lib/sqlite_different.sql',
46 connection_details => [@different_connection_details],
47 directory => 't/var/fixtures'
49 'mysql populate okay');
51 ok($fixtures->populate({
52 ddl => 't/lib/sqlite.sql',
53 connection_details => ['dbi:SQLite:t/var/DBIxClass.db', '', ''],
54 directory => 't/var/fixtures'
56 'sqlite populate okay');
58 $schema = DBICTest->init_schema(no_deploy => 1);
59 is($schema->resultset('Artist')->count, 1, 'artist imported to sqlite okay');