1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2 use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat';
9 use lib 't/cdbi/testlib';
10 use DBICTest::Util 'class_seems_loaded';
13 # Test that has_many() will load the foreign class
14 ok ! class_seems_loaded('Film'), 'Start non-loaded';
15 ok eval { Director->has_many( films => 'Film' ); 1; } or diag $@;
17 my $shan_hua = Director->create({
21 my $inframan = Film->create({
23 Director => "Shan Hua",
25 my $guillotine2 = Film->create({
26 Title => "Flying Guillotine 2",
27 Director => "Shan Hua",
29 my $guillotine = Film->create({
30 Title => "Master of the Flying Guillotine",
31 Director => "Yu Wang",
34 is_deeply [sort $shan_hua->films], [sort $inframan, $guillotine2];