X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FTrack.pm;fp=t%2Flib%2FDBICTest%2FSchema%2FTrack.pm;h=a57fcb54b912bf3eba865ca25f52342ebe805a68;hb=6fbef4a4db1f453046b0450c485c495d743030d5;hp=fb9e5c52b9e8c59a4ab092a65f26ee154833c448;hpb=a697fa319ce0072206b76f64fed38d92d5f59644;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/Track.pm b/t/lib/DBICTest/Schema/Track.pm index fb9e5c5..a57fcb5 100644 --- a/t/lib/DBICTest/Schema/Track.pm +++ b/t/lib/DBICTest/Schema/Track.pm @@ -2,6 +2,8 @@ package # hide from PAUSE DBICTest::Schema::Track; use base qw/DBICTest::BaseResult/; +use Carp qw/confess/; + __PACKAGE__->load_components(qw/InflateColumn::DateTime Ordered/); __PACKAGE__->table('track'); @@ -67,6 +69,15 @@ __PACKAGE__->might_have ( next_track => __PACKAGE__, sub { my $args = shift; + + # This is for test purposes only. A regular user does not + # need to sanity check the passed-in arguments, this is what + # the tests are for :) + my @missing_args = grep { ! defined $args->{$_} } + qw/self_alias foreign_alias self_resultsource foreign_relname/; + confess "Required arguments not supplied to custom rel coderef: @missing_args\n" + if @missing_args; + return ( { "$args->{foreign_alias}.cd" => { -ident => "$args->{self_alias}.cd" }, "$args->{foreign_alias}.position" => { '>' => { -ident => "$args->{self_alias}.position" } },