1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
10 my $schema = DBICTest->init_schema();
12 $schema->resultset('Artist')->delete;
13 $schema->resultset('CD')->delete;
15 my $artist = $schema->resultset("Artist")->create({ artistid => 21, name => 'Michael Jackson', rank => 20 });
16 my $cd = $artist->create_related('cds', { year => 1975, title => 'Compilation from 1975' });
18 $schema->is_executed_sql_bind(sub {
19 my $find_cd = $artist->find_related('cds',{title => 'Compilation from 1975'});
22 ' SELECT me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track
24 WHERE me.artist = ? AND me.title = ?
27 [ { dbic_colname => "me.artist", sqlt_datatype => "integer" }
29 [ { dbic_colname => "me.title", sqlt_datatype => "varchar", sqlt_size => 100 }
30 => "Compilation from 1975" ],
32 ], 'find_related only uses foreign key condition once' );