X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frelationship%2Fcore.t;h=d6cb3a3f7020bfb574aa65fa7ff7dd85b73ace5f;hb=refs%2Fheads%2Fpeople%2Fcaldrin%2Fcompose_namespace_fixes;hp=b888d838c2c0d09a0c8623612f26570587189cb5;hpb=4017fe64b73811266b1d54e4e68764a1d87d973d;p=dbsrgits%2FDBIx-Class.git diff --git a/t/relationship/core.t b/t/relationship/core.t index b888d83..d6cb3a3 100644 --- a/t/relationship/core.t +++ b/t/relationship/core.t @@ -89,13 +89,10 @@ $track->set_from_related( cd => undef ); ok( !defined($track->cd), 'set_from_related with undef ok'); -TODO: { - local $TODO = 'accessing $object->rel and set_from_related'; - my $track = $schema->resultset("Track")->new( {} ); - $track->cd; - $track->set_from_related( cd => $cd ); - ok ($track->cd, 'set_from_related ok after using the accessor' ); -}; +$track = $schema->resultset("Track")->new( {} ); +$track->cd; +$track->set_from_related( cd => $cd ); +ok ($track->cd, 'set_from_related ok after using the accessor' ); # update_from_related, the same as set_from_related, but it calls update afterwards $track = $schema->resultset("Track")->create( { @@ -105,7 +102,7 @@ $track = $schema->resultset("Track")->create( { } ); $track->update_from_related( cd => $cd ); -my $t_cd = ($schema->resultset("Track")->search( cd => 4, title => 'Hidden Track 2' ))[0]->cd; +my $t_cd = ($schema->resultset("Track")->search({ cd => 4, title => 'Hidden Track 2' }))[0]->cd; is( $t_cd->cdid, 4, 'update_from_related ok' ); @@ -124,7 +121,7 @@ is( $cd->title, 'Greatest Hits', 'find_or_create_related new record ok' ); is( ($artist->search_related('cds'))[4]->title, 'Greatest Hits', 'find_or_create_related new record search ok' ); $artist->delete_related( cds => { title => 'Greatest Hits' }); -cmp_ok( $schema->resultset("CD")->search( title => 'Greatest Hits' ), '==', 0, 'delete_related ok' ); +cmp_ok( $schema->resultset("CD")->search({ title => 'Greatest Hits' }), '==', 0, 'delete_related ok' ); # find_or_new_related with an existing record $cd = $artist->find_or_new_related( 'cds', { title => 'Big Flop' } ); @@ -178,7 +175,7 @@ my @producers = $cd->producers(); is( $producers[0]->name, 'Matt S Trout', 'many_to_many ok' ); is( $cd->producers_sorted->next->name, 'Bob The Builder', 'sorted many_to_many ok' ); -is( $cd->producers_sorted(producerid => 3)->next->name, 'Fred The Phenotype', +is( $cd->producers_sorted({producerid => 3})->next->name, 'Fred The Phenotype', 'sorted many_to_many with search condition ok' ); $cd = $schema->resultset('CD')->find(2);