use lib qw(t/lib);
use DBICTest;
-plan tests => 31;
+plan tests => 40;
my $schema = DBICTest->init_schema();
my $rs = $schema->resultset('Artist');
ok( $crap->name eq 'Manufactured Crap', "Got Correct name for result object");
ok( $girl->name eq 'Angsty-Whiny Girl', "Got Correct name for result object");
ok( $xxxaaa->name eq 'bbbb', "Got Correct name for result object");
-
- use Data::Dump qw/dump/;
-
+
ok( $crap->cds->count == 2, "got Expected Number of Cds");
ok( $girl->cds->count == 3, "got Expected Number of Cds");
}
is($artist->cds->count, 1, 'Has One CD');
}
+RETURN_RESULTSETS_AUTOPK: {
+
+ my ($crap, $girl, $damn, $xxxaaa) = $rs->populate( [
+ { name => 'Manufactured CrapC', cds => [
+ { title => 'My First CD', year => 2006 },
+ { title => 'Yet More Tweeny-Pop crap', year => 2007 },
+ ]
+ },
+ { name => 'Angsty-Whiny GirlC', cds => [
+ { title => 'My parents sold me to a record company' ,year => 2005 },
+ { title => 'Why Am I So Ugly?', year => 2006 },
+ { title => 'I Got Surgery and am now Popular', year => 2007 }
+
+ ]
+ },
+ { name => 'Like I Give a DamnC' },
+
+ { name => 'bbbbC', cds => [
+ { title => 'xxxaaa' ,year => 2005 },
+ ]
+ },
+
+ ] );
+
+ isa_ok( $crap, 'DBICTest::Artist', "Got 'Artist'");
+ isa_ok( $damn, 'DBICTest::Artist', "Got 'Artist'");
+ isa_ok( $girl, 'DBICTest::Artist', "Got 'Artist'");
+ isa_ok( $xxxaaa, 'DBICTest::Artist', "Got 'Artist'");
+
+ ok( $crap->name eq 'Manufactured CrapC', "Got Correct name for result object");
+ ok( $girl->name eq 'Angsty-Whiny GirlC', "Got Correct name for result object");
+ ok( $xxxaaa->name eq 'bbbbC', "Got Correct name for result object");
+
+ ok( $crap->cds->count == 2, "got Expected Number of Cds");
+ ok( $girl->cds->count == 3, "got Expected Number of Cds");
+}
+