1 use DBIx::Class::Fixtures;
3 use File::Path 'rmtree';
8 (my $schema = ExtraTest::Schema->connect(
9 'DBI:SQLite::memory:','',''))->init_schema;
11 open(my $fh, '<', 't/18-extra.t') ||
12 die "Can't open the filehandle, test is trash!";
23 my $fixtures = DBIx::Class::Fixtures
25 config_dir => 't/var/configs',
26 config_attrs => { photo_dir => './t/var/files' },
31 config => 'extra.json',
33 directory => "t/var/fixtures/photos" }),
34 'fetch dump executed okay');
36 ok my $key = $schema->resultset('Photo')->first->file;
38 ok -e $key, 'File Created';
40 ok $schema->resultset('Photo')->delete;
42 ok ! -e $key, 'File Deleted';
48 directory => "t/var/fixtures/photos"}),
51 is $key, $schema->resultset('Photo')->first->file,
54 ok -e $key, 'File Restored';
60 rmtree 't/var/fixtures/photos';