From: Peter Rabbitson Date: Sun, 5 Jul 2015 09:48:35 +0000 (+0200) Subject: Change incomprehensible names of test relationships from e98e6478 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=576ae54b66e0c8e83be42713de0cc22bfbc731cf;p=dbsrgits%2FDBIx-Class.git Change incomprehensible names of test relationships from e98e6478 No functional changes yet, just renames --- diff --git a/t/lib/DBICTest/Schema/Artwork.pm b/t/lib/DBICTest/Schema/Artwork.pm index ddc87cd..a167475 100644 --- a/t/lib/DBICTest/Schema/Artwork.pm +++ b/t/lib/DBICTest/Schema/Artwork.pm @@ -22,11 +22,12 @@ __PACKAGE__->has_many('artwork_to_artist', 'DBICTest::Schema::Artwork_to_Artist' __PACKAGE__->many_to_many('artists', 'artwork_to_artist', 'artist'); # both to test manytomany with custom rel -__PACKAGE__->many_to_many('artists_test_m2m', 'artwork_to_artist', 'artist_test_m2m'); -__PACKAGE__->many_to_many('artists_test_m2m_noopt', 'artwork_to_artist', 'artist_test_m2m_noopt'); +# (deliberate misnamed accessor clash) +__PACKAGE__->many_to_many('artist_limited_rank', 'artwork_to_artist', 'artist_limited_rank'); +__PACKAGE__->many_to_many('artist_limited_rank_opaque', 'artwork_to_artist', 'artist_limited_rank_opaque'); # other test to manytomany -__PACKAGE__->has_many('artwork_to_artist_test_m2m', 'DBICTest::Schema::Artwork_to_Artist', +__PACKAGE__->has_many('artwork_to_artist_via_customcond', 'DBICTest::Schema::Artwork_to_Artist', sub { # This is for test purposes only. A regular user does not # need to sanity check the passed-in arguments, this is what @@ -42,6 +43,7 @@ __PACKAGE__->has_many('artwork_to_artist_test_m2m', 'DBICTest::Schema::Artwork_t ); } ); -__PACKAGE__->many_to_many('artists_test_m2m2', 'artwork_to_artist_test_m2m', 'artist'); +__PACKAGE__->many_to_many('artists_via_customcond', 'artwork_to_artist_via_customcond', 'artist'); + 1; diff --git a/t/lib/DBICTest/Schema/Artwork_to_Artist.pm b/t/lib/DBICTest/Schema/Artwork_to_Artist.pm index 8a33928..052da73 100644 --- a/t/lib/DBICTest/Schema/Artwork_to_Artist.pm +++ b/t/lib/DBICTest/Schema/Artwork_to_Artist.pm @@ -22,7 +22,7 @@ __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__->belongs_to('artist_test_m2m', 'DBICTest::Schema::Artist', +__PACKAGE__->belongs_to('artist_limited_rank', 'DBICTest::Schema::Artist', sub { # This is for test purposes only. A regular user does not # need to sanity check the passed-in arguments, this is what @@ -41,7 +41,7 @@ __PACKAGE__->belongs_to('artist_test_m2m', 'DBICTest::Schema::Artist', } ); -__PACKAGE__->belongs_to('artist_test_m2m_noopt', 'DBICTest::Schema::Artist', +__PACKAGE__->belongs_to('artist_limited_rank_opaque', 'DBICTest::Schema::Artist', sub { # This is for test purposes only. A regular user does not # need to sanity check the passed-in arguments, this is what diff --git a/t/relationship/custom.t b/t/relationship/custom.t index f79b605..564142b 100644 --- a/t/relationship/custom.t +++ b/t/relationship/custom.t @@ -225,28 +225,28 @@ my @artwork_artists = $artwork->artwork_to_artist->all; foreach (@artwork_artists) { lives_ok { my $artista = $_->artist; - my $artistb = $_->artist_test_m2m; + my $artistb = $_->artist_limited_rank; ok($artista->rank < 10 ? $artistb : 1, 'belongs_to with custom rel works.'); - my $artistc = $_->artist_test_m2m_noopt; + my $artistc = $_->artist_limited_rank_opaque; ok($artista->rank < 10 ? $artistc : 1, 'belongs_to with custom rel works even in non-simplified.'); } 'belongs_to works with custom rels'; } @artists = (); lives_ok { - @artists = $artwork->artists_test_m2m2->all; + @artists = $artwork->artists_via_customcond->all; } 'manytomany with extended rels in the has many works'; is(scalar @artists, 2, 'two artists'); @artists = (); lives_ok { - @artists = $artwork->artists_test_m2m->all; + @artists = $artwork->artist_limited_rank->all; } 'can fetch many to many with optimized version'; is(scalar @artists, 1, 'only one artist is associated'); @artists = (); lives_ok { - @artists = $artwork->artists_test_m2m_noopt->all; + @artists = $artwork->artist_limited_rank_opaque->all; } 'can fetch many to many with non-optimized version'; is(scalar @artists, 1, 'only one artist is associated');