Add strict/warnings test, adjust all offenders (wow, that was a lot)
[dbsrgits/DBIx-Class.git] / t / cdbi / has_many_loads_foreign_class.t
CommitLineData
4656f62f 1use strict;
4a233f30 2use warnings;
4656f62f 3use Test::More;
db29433c 4use Class::Inspector ();
4656f62f 5
4656f62f 6
50891152 7use lib 't/cdbi/testlib';
4656f62f 8use Director;
9
10# Test that has_many() will load the foreign class.
11ok !Class::Inspector->loaded( 'Film' );
12ok eval { Director->has_many( films => 'Film' ); 1; } || diag $@;
13
14my $shan_hua = Director->create({
15 Name => "Shan Hua",
16});
17
18my $inframan = Film->create({
19 Title => "Inframan",
20 Director => "Shan Hua",
21});
22my $guillotine2 = Film->create({
23 Title => "Flying Guillotine 2",
24 Director => "Shan Hua",
25});
26my $guillotine = Film->create({
27 Title => "Master of the Flying Guillotine",
28 Director => "Yu Wang",
29});
30
d9bd5195 31is_deeply [sort $shan_hua->films], [sort $inframan, $guillotine2];
32
33done_testing;