Permalink
Browse files

rename occurences of belongs_to in tests

  • Loading branch information...
1 parent 5d22bb7 commit f54cb4d66292431efc26b4d14b22ebf9228cc7b9 @wchristian wchristian committed Mar 1, 2013
Showing with 98 additions and 98 deletions.
  1. +5 −5 t/101populate_rs.t
  2. +2 −2 t/103many_to_many_warning.t
  3. +1 −1 t/71mysql.t
  4. +1 −1 t/73oracle_hq.t
  5. +1 −1 t/746mssql.t
  6. +1 −1 t/inflate/hri.t
  7. +2 −2 t/lib/DBICTest/Schema/ArtistUndirectedMap.pm
  8. +1 −1 t/lib/DBICTest/Schema/Artwork.pm
  9. +4 −4 t/lib/DBICTest/Schema/Artwork_to_Artist.pm
  10. +1 −1 t/lib/DBICTest/Schema/Bookmark.pm
  11. +1 −1 t/lib/DBICTest/Schema/BooksInLibrary.pm
  12. +5 −5 t/lib/DBICTest/Schema/CD.pm
  13. +2 −2 t/lib/DBICTest/Schema/CD_to_Producer.pm
  14. +2 −2 t/lib/DBICTest/Schema/CollectionObject.pm
  15. +1 −1 t/lib/DBICTest/Schema/Employee.pm
  16. +1 −1 t/lib/DBICTest/Schema/ForceForeign.pm
  17. +2 −2 t/lib/DBICTest/Schema/FourKeys_to_TwoKeys.pm
  18. +1 −1 t/lib/DBICTest/Schema/Image.pm
  19. +1 −1 t/lib/DBICTest/Schema/LinerNotes.pm
  20. +1 −1 t/lib/DBICTest/Schema/LyricVersion.pm
  21. +1 −1 t/lib/DBICTest/Schema/Lyrics.pm
  22. +2 −2 t/lib/DBICTest/Schema/SelfRefAlias.pm
  23. +1 −1 t/lib/DBICTest/Schema/Tag.pm
  24. +4 −4 t/lib/DBICTest/Schema/Track.pm
  25. +1 −1 t/lib/DBICTest/Schema/TreeLike.pm
  26. +1 −1 t/lib/DBICTest/Schema/TwoKeyTreeLike.pm
  27. +2 −2 t/lib/DBICTest/Schema/TwoKeys.pm
  28. +1 −1 t/lib/DBICTest/Schema/Year1999CDs.pm
  29. +1 −1 t/lib/DBICTest/Schema/Year2000CDs.pm
  30. +2 −2 t/lib/PrefetchBug/LeftRight.pm
  31. +1 −1 t/lib/ViewDeps/Result/Artwork.pm
  32. +1 −1 t/lib/ViewDeps/Result/CD.pm
  33. +1 −1 t/lib/ViewDeps/Result/Track.pm
  34. +1 −1 t/lib/ViewDeps/Result/TrackNumberFives.pm
  35. +1 −1 t/lib/ViewDeps/Result/Year2010CDs.pm
  36. +1 −1 t/lib/ViewDeps/Result/Year2010CDsWithManyTracks.pm
  37. +1 −1 t/lib/ViewDepsBad/Result/Artwork.pm
  38. +1 −1 t/lib/ViewDepsBad/Result/CD.pm
  39. +1 −1 t/lib/ViewDepsBad/Result/Track.pm
  40. +1 −1 t/lib/ViewDepsBad/Result/TrackNumberFives.pm
  41. +1 −1 t/lib/ViewDepsBad/Result/Year2010CDs.pm
  42. +1 −1 t/lib/ViewDepsBad/Result/Year2010CDsWithManyTracks.pm
  43. +2 −2 t/multi_create/diamond.t
  44. +1 −1 t/multi_create/in_memory.t
  45. +1 −1 t/multi_create/standard.t
  46. +1 −1 t/prefetch/diamond.t
  47. +1 −1 t/prefetch/grouped.t
  48. +1 −1 t/prefetch/join_type.t
  49. +3 −3 t/prefetch/o2m_o2m_order_by_with_limit.t
  50. +2 −2 t/prefetch/standard.t
  51. +6 −6 t/relationship/core.t
  52. +3 −3 t/relationship/custom.t
  53. +6 −6 t/relationship/info.t
  54. +7 −7 t/relationship/set_column_on_fk.t
View
@@ -2,7 +2,7 @@
## Tests for the $resultset->populate method.
##
## GOALS: We need to test the method for both void and array context for all
-## the following relationship types: belongs_to, has_many. Additionally we
+## the following relationship types: refers_to, has_many. Additionally we
## need to test each of those for both specified PK's and autogenerated PK's
##
## Also need to test some stuff that should generate errors.
@@ -272,7 +272,7 @@ ARRAY_CONTEXT: {
BELONGS_TO_NO_PKs: {
- ## Test from a belongs_to perspective, should create artist first,
+ ## Test from a refers_to perspective, should create artist first,
## then CD with artistid. This test we let the system automatically
## create the PK's. Chances are good you'll use it this way mostly.
@@ -304,7 +304,7 @@ ARRAY_CONTEXT: {
BELONGS_TO_WITH_PKs: {
- ## Test from a belongs_to perspective, should create artist first,
+ ## Test from a refers_to perspective, should create artist first,
## then CD with artistid. This time we try setting the PK's
my $aid = $art_rs->get_column('artistid')->max || 0;
@@ -455,7 +455,7 @@ VOID_CONTEXT: {
BELONGS_TO_WITH_PKs: {
- ## Test from a belongs_to perspective, should create artist first,
+ ## Test from a refers_to perspective, should create artist first,
## then CD with artistid. This time we try setting the PK's
my $aid = $art_rs->get_column('artistid')->max || 0;
@@ -492,7 +492,7 @@ VOID_CONTEXT: {
BELONGS_TO_NO_PKs: {
- ## Test from a belongs_to perspective, should create artist first,
+ ## Test from a refers_to perspective, should create artist first,
## then CD with artistid.
my $cds = [
@@ -74,8 +74,8 @@ use warnings;
data_type => 'integer',
},
);
- __PACKAGE__->belongs_to('foo' => 'DBICTest::Schema::Foo${suffix}');
- __PACKAGE__->belongs_to('bar' => 'DBICTest::Schema::Foo${suffix}');
+ __PACKAGE__->refers_to('foo' => 'DBICTest::Schema::Foo${suffix}');
+ __PACKAGE__->refers_to('bar' => 'DBICTest::Schema::Foo${suffix}');
}
{
package #
View
@@ -158,7 +158,7 @@ $schema->populate ('BooksInLibrary', [
is ($_->count, 2, 'Prefetched grouped search returns correct count');
}
- # try a ->belongs_to direction (no select collapse)
+ # try a ->refers_to direction (no select collapse)
my $books = $schema->resultset ('BooksInLibrary')->search (
{ 'owner.name' => 'wiggle' },
{ prefetch => 'owner', distinct => 1 }
View
@@ -33,7 +33,7 @@ BEGIN {
{ 'foreign.parentid' => 'self.artistid' }
);
- DBICTest::Schema::Artist->belongs_to(
+ DBICTest::Schema::Artist->refers_to(
parent => 'DBICTest::Schema::Artist',
{ 'foreign.artistid' => 'self.parentid' }
);
View
@@ -406,7 +406,7 @@ SQL
}
- # try a ->belongs_to direction (no select collapse, group_by should work)
+ # try a ->refers_to direction (no select collapse, group_by should work)
my $books = $schema->resultset ('BooksInLibrary')->search (
{
'owner.name' => [qw/wiggle woggle/],
View
@@ -78,7 +78,7 @@ sub check_cols_of {
if (not ref ($datahashref->{$col}) ) {
is ($datahashref->{$col}, $dbic_obj->get_column($col), 'same value');
}
- # related table entry (belongs_to)
+ # related table entry (refers_to)
elsif (ref ($datahashref->{$col}) eq 'HASH') {
check_cols_of($dbic_obj->$col, $datahashref->{$col});
}
@@ -13,8 +13,8 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/id1 id2/);
-__PACKAGE__->belongs_to( 'artist1', 'DBICTest::Schema::Artist', 'id1', { on_delete => 'RESTRICT', on_update => 'CASCADE'} );
-__PACKAGE__->belongs_to( 'artist2', 'DBICTest::Schema::Artist', 'id2', { on_delete => undef, on_update => undef} );
+__PACKAGE__->refers_to( 'artist1', 'DBICTest::Schema::Artist', 'id1', { on_delete => 'RESTRICT', on_update => 'CASCADE'} );
+__PACKAGE__->refers_to( 'artist2', 'DBICTest::Schema::Artist', 'id2', { on_delete => undef, on_update => undef} );
__PACKAGE__->has_many(
'mapped_artists', 'DBICTest::Schema::Artist',
[ {'foreign.artistid' => 'self.id1'}, {'foreign.artistid' => 'self.id2'} ],
@@ -15,7 +15,7 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key('cd_id');
-__PACKAGE__->belongs_to('cd', 'DBICTest::Schema::CD', 'cd_id');
+__PACKAGE__->refers_to('cd', 'DBICTest::Schema::CD', 'cd_id');
__PACKAGE__->has_many('images', 'DBICTest::Schema::Image', 'artwork_id');
__PACKAGE__->has_many('artwork_to_artist', 'DBICTest::Schema::Artwork_to_Artist', 'artwork_cd_id');
@@ -19,10 +19,10 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key(qw/artwork_cd_id artist_id/);
-__PACKAGE__->belongs_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_cd_id');
-__PACKAGE__->belongs_to('artist', 'DBICTest::Schema::Artist', 'artist_id');
+__PACKAGE__->refers_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_cd_id');
+__PACKAGE__->refers_to('artist', 'DBICTest::Schema::Artist', 'artist_id');
-__PACKAGE__->belongs_to('artist_test_m2m', 'DBICTest::Schema::Artist',
+__PACKAGE__->refers_to('artist_test_m2m', 'DBICTest::Schema::Artist',
sub {
my $args = shift;
@@ -46,7 +46,7 @@ __PACKAGE__->belongs_to('artist_test_m2m', 'DBICTest::Schema::Artist',
}
);
-__PACKAGE__->belongs_to('artist_test_m2m_noopt', 'DBICTest::Schema::Artist',
+__PACKAGE__->refers_to('artist_test_m2m_noopt', 'DBICTest::Schema::Artist',
sub {
my $args = shift;
@@ -21,7 +21,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
require DBICTest::Schema::Link; # so we can get a columnlist
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
link => 'DBICTest::Schema::Link', 'link', {
on_delete => 'SET NULL',
join_type => 'LEFT',
@@ -34,6 +34,6 @@ __PACKAGE__->add_unique_constraint (['title']);
__PACKAGE__->resultset_attributes({where => { source => "Library" } });
-__PACKAGE__->belongs_to ( owner => 'DBICTest::Schema::Owners', 'owner' );
+__PACKAGE__->refers_to ( owner => 'DBICTest::Schema::Owners', 'owner' );
1;
@@ -40,16 +40,16 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('cdid');
__PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
-__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, {
+__PACKAGE__->refers_to( artist => 'DBICTest::Schema::Artist', undef, {
is_deferrable => 1,
proxy => { artist_name => 'name' },
});
-__PACKAGE__->belongs_to( very_long_artist_relationship => 'DBICTest::Schema::Artist', 'artist', {
+__PACKAGE__->refers_to( very_long_artist_relationship => 'DBICTest::Schema::Artist', 'artist', {
is_deferrable => 1,
});
# in case this is a single-cd it promotes a track from another cd
-__PACKAGE__->belongs_to( single_track => 'DBICTest::Schema::Track', 'single_track',
+__PACKAGE__->refers_to( single_track => 'DBICTest::Schema::Track', 'single_track',
{ join_type => 'left'}
);
@@ -75,7 +75,7 @@ __PACKAGE__->many_to_many(
{ order_by => 'producer.name' },
);
-__PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre',
+__PACKAGE__->refers_to('genre', 'DBICTest::Schema::Genre',
{ 'foreign.genreid' => 'self.genreid' },
{
join_type => 'left',
@@ -86,7 +86,7 @@ __PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre',
#This second relationship was added to test the short-circuiting of pointless
#queries provided by undef_on_null_fk. the relevant test in 66relationship.t
-__PACKAGE__->belongs_to('genre_inefficient', 'DBICTest::Schema::Genre',
+__PACKAGE__->refers_to('genre_inefficient', 'DBICTest::Schema::Genre',
{ 'foreign.genreid' => 'self.genreid' },
{
join_type => 'left',
@@ -14,12 +14,12 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/cd producer/);
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
'cd', 'DBICTest::Schema::CD',
{ 'foreign.cdid' => 'self.cd' }
);
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
'producer', 'DBICTest::Schema::Producer',
{ 'foreign.producerid' => 'self.producer' },
{ on_delete => undef, on_update => undef },
@@ -17,10 +17,10 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/collection object/);
-__PACKAGE__->belongs_to( collection => "DBICTest::Schema::Collection",
+__PACKAGE__->refers_to( collection => "DBICTest::Schema::Collection",
{ "foreign.collectionid" => "self.collection" }
);
-__PACKAGE__->belongs_to( object => "DBICTest::Schema::TypedObject",
+__PACKAGE__->refers_to( object => "DBICTest::Schema::TypedObject",
{ "foreign.objectid" => "self.object" }
);
@@ -47,7 +47,7 @@ __PACKAGE__->position_column('position');
# Do not add unique constraints here - different groups are used throughout
# the ordered tests
-__PACKAGE__->belongs_to (secretkey => 'DBICTest::Schema::Encoded', 'encoded', {
+__PACKAGE__->refers_to (secretkey => 'DBICTest::Schema::Encoded', 'encoded', {
join_type => 'left'
});
@@ -27,7 +27,7 @@ __PACKAGE__->might_have('cd_1', 'DBICTest::Schema::CD',
);
# Normally this would appear as a FK constraint
-__PACKAGE__->belongs_to('cd_3', 'DBICTest::Schema::CD',
+__PACKAGE__->refers_to('cd_3', 'DBICTest::Schema::CD',
{ 'foreign.cdid' => 'self.cd' },
{ is_foreign_key_constraint => 0 },
);
@@ -21,14 +21,14 @@ __PACKAGE__->set_primary_key(
qw/f_foo f_bar f_hello f_goodbye t_artist t_cd/
);
-__PACKAGE__->belongs_to('fourkeys', 'DBICTest::Schema::FourKeys', {
+__PACKAGE__->refers_to('fourkeys', 'DBICTest::Schema::FourKeys', {
'foreign.foo' => 'self.f_foo',
'foreign.bar' => 'self.f_bar',
'foreign.hello' => 'self.f_hello',
'foreign.goodbye' => 'self.f_goodbye',
});
-__PACKAGE__->belongs_to('twokeys', 'DBICTest::Schema::TwoKeys', {
+__PACKAGE__->refers_to('twokeys', 'DBICTest::Schema::TwoKeys', {
'foreign.artist' => 'self.t_artist',
'foreign.cd' => 'self.t_cd',
});
@@ -26,6 +26,6 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_id');
+__PACKAGE__->refers_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_id');
1;
@@ -17,7 +17,7 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key('liner_id');
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
'cd', 'DBICTest::Schema::CD', 'liner_id'
);
@@ -22,6 +22,6 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to('lyric', 'DBICTest::Schema::Lyrics', 'lyric_id');
+__PACKAGE__->refers_to('lyric', 'DBICTest::Schema::Lyrics', 'lyric_id');
1;
@@ -18,7 +18,7 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key('lyric_id');
-__PACKAGE__->belongs_to('track', 'DBICTest::Schema::Track', 'track_id');
+__PACKAGE__->refers_to('track', 'DBICTest::Schema::Track', 'track_id');
__PACKAGE__->has_many('lyric_versions', 'DBICTest::Schema::LyricVersion', 'lyric_id');
1;
@@ -17,7 +17,7 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/self_ref alias/);
-__PACKAGE__->belongs_to( self_ref => 'DBICTest::Schema::SelfRef' );
-__PACKAGE__->belongs_to( alias => 'DBICTest::Schema::SelfRef' );
+__PACKAGE__->refers_to( self_ref => 'DBICTest::Schema::SelfRef' );
+__PACKAGE__->refers_to( alias => 'DBICTest::Schema::SelfRef' );
1;
@@ -31,7 +31,7 @@ __PACKAGE__->add_unique_constraints( # do not remove, part of a test
[qw/ tagid tag cd /],
);
-__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD', 'cd', {
+__PACKAGE__->refers_to( cd => 'DBICTest::Schema::CD', 'cd', {
proxy => [ 'year', { cd_title => 'title' } ],
});
@@ -49,23 +49,23 @@ __PACKAGE__->position_column ('position');
__PACKAGE__->grouping_column ('cd');
-__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD', undef, {
+__PACKAGE__->refers_to( cd => 'DBICTest::Schema::CD', undef, {
proxy => { cd_title => 'title' },
});
-__PACKAGE__->belongs_to( disc => 'DBICTest::Schema::CD' => 'cd', {
+__PACKAGE__->refers_to( disc => 'DBICTest::Schema::CD' => 'cd', {
proxy => 'year'
});
__PACKAGE__->might_have( cd_single => 'DBICTest::Schema::CD', 'single_track' );
__PACKAGE__->might_have( lyrics => 'DBICTest::Schema::Lyrics', 'track_id' );
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
"year1999cd",
"DBICTest::Schema::Year1999CDs",
{ "foreign.cdid" => "self.cd" },
{ join_type => 'left' }, # the relationship is of course optional
);
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
"year2000cd",
"DBICTest::Schema::Year2000CDs",
{ "foreign.cdid" => "self.cd" },
@@ -15,7 +15,7 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key(qw/id/);
-__PACKAGE__->belongs_to('parent', 'TreeLike',
+__PACKAGE__->refers_to('parent', 'TreeLike',
{ 'foreign.id' => 'self.parent' });
__PACKAGE__->has_many('children', 'TreeLike', { 'foreign.parent' => 'self.id' });
@@ -18,7 +18,7 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/id1 id2/);
__PACKAGE__->add_unique_constraint('tktlnameunique' => ['name']);
-__PACKAGE__->belongs_to('parent', 'DBICTest::Schema::TwoKeyTreeLike',
+__PACKAGE__->refers_to('parent', 'DBICTest::Schema::TwoKeyTreeLike',
{ 'foreign.id1' => 'self.parent1', 'foreign.id2' => 'self.parent2'});
1;
@@ -13,12 +13,12 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/artist cd/);
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
artist => 'DBICTest::Schema::Artist',
{'foreign.artistid'=>'self.artist'},
);
-__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD', undef, { is_deferrable => 0, add_fk_index => 0 } );
+__PACKAGE__->refers_to( cd => 'DBICTest::Schema::CD', undef, { is_deferrable => 0, add_fk_index => 0 } );
__PACKAGE__->has_many(
'fourkeys_to_twokeys', 'DBICTest::Schema::FourKeys_to_TwoKeys', {
@@ -35,7 +35,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('cdid');
__PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
-__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
+__PACKAGE__->refers_to( artist => 'DBICTest::Schema::Artist' );
__PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track',
{ "foreign.cd" => "self.cdid" });
@@ -15,7 +15,7 @@ __PACKAGE__->result_source_instance->view_definition( sprintf (
join (', ', __PACKAGE__->columns),
));
-__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
+__PACKAGE__->refers_to( artist => 'DBICTest::Schema::Artist' );
__PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track',
{ "foreign.cd" => "self.cdid" });
@@ -13,8 +13,8 @@ __PACKAGE__->add_columns(
value => {});
__PACKAGE__->set_primary_key('left_id', 'right_id');
-__PACKAGE__->belongs_to(left => 'PrefetchBug::Left', 'left_id');
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(left => 'PrefetchBug::Left', 'left_id');
+__PACKAGE__->refers_to(
right => 'PrefetchBug::Right',
'right_id',
# {join_type => 'left'}
Oops, something went wrong.

0 comments on commit f54cb4d

Please sign in to comment.