X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frelationship%2Fcore.t;fp=t%2Frelationship%2Fcore.t;h=5b75e8d0ffb4b0c86dccb9492d07756bb46189f2;hb=f54cb4d66292431efc26b4d14b22ebf9228cc7b9;hp=96c50663f4fb959d5f114f316343c26b414538c7;hpb=5d22bb74b308ad7ca28cedd1ffcfd92c106b1e68;p=dbsrgits%2FDBIx-Class.git diff --git a/t/relationship/core.t b/t/relationship/core.t index 96c5066..5b75e8d 100644 --- a/t/relationship/core.t +++ b/t/relationship/core.t @@ -54,9 +54,9 @@ is( $big_flop_cd->title, 'Big Flop', 'create_related ok' ); $schema->storage->debugcb(sub { $queries++; }); $schema->storage->debug(1); $big_flop_cd->genre; #should not trigger a select query - is($queries, 0, 'No SELECT made for belongs_to if key IS NULL'); + is($queries, 0, 'No SELECT made for refers_to if key IS NULL'); $big_flop_cd->genre_inefficient; #should trigger a select query - is($queries, 1, 'SELECT made for belongs_to if key IS NULL when undef_on_null_fk disabled'); + is($queries, 1, 'SELECT made for refers_to if key IS NULL when undef_on_null_fk disabled'); $schema->storage->debug($sdebug); $schema->storage->debugcb(undef); } @@ -295,7 +295,7 @@ my $trackset = $artist->cds->search_related('tracks'); is($trackset->count, 10, "Correct number of tracks for artist"); is($trackset->all, 10, "Correct number of track objects for artist"); -# now see about updating eveything that belongs to artist 2 to artist 3 +# now see about updating eveything that refers to artist 2 to artist 3 $artist = $schema->resultset("Artist")->find(2); my $nartist = $schema->resultset("Artist")->find(3); cmp_ok($artist->cds->count, '==', 1, "Correct orig #cds for artist"); @@ -307,14 +307,14 @@ cmp_ok($nartist->cds->count, '==', 2, "Correct new #cds for artist"); # check if is_foreign_key_constraint attr is set my $rs_normal = $schema->source('Track'); my $relinfo = $rs_normal->relationship_info ('cd'); -cmp_ok($relinfo->{attrs}{is_foreign_key_constraint}, '==', 1, "is_foreign_key_constraint defined for belongs_to relationships."); +cmp_ok($relinfo->{attrs}{is_foreign_key_constraint}, '==', 1, "is_foreign_key_constraint defined for refers_to relationships."); my $rs_overridden = $schema->source('ForceForeign'); my $relinfo_with_attr = $rs_overridden->relationship_info ('cd_3'); -cmp_ok($relinfo_with_attr->{attrs}{is_foreign_key_constraint}, '==', 0, "is_foreign_key_constraint defined for belongs_to relationships with attr."); +cmp_ok($relinfo_with_attr->{attrs}{is_foreign_key_constraint}, '==', 0, "is_foreign_key_constraint defined for refers_to relationships with attr."); # check that relationships below left join relationships are forced to left joins -# when traversing multiple belongs_to +# when traversing multiple refers_to my $cds = $schema->resultset("CD")->search({ 'me.cdid' => 5 }, { join => { single_track => 'cd' } }); is($cds->count, 1, "subjoins under left joins force_left (string)");