X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FUtil.pm;h=3760df8a3aeb848768b63fcf663a6cccae9025b8;hb=e884e5d9de1fcb734ab4598e6b2923293b0674f7;hp=0588a9dd7e4e4dd3d5bb5d67fbdcc74b219a768c;hpb=e56f8014edf6718cf0d3f1f43c2a3080bcb7e2e3;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/lib/DBICTest/Util.pm b/t/lib/DBICTest/Util.pm index 0588a9d..3760df8 100644 --- a/t/lib/DBICTest/Util.pm +++ b/t/lib/DBICTest/Util.pm @@ -99,10 +99,10 @@ sub check_customcond_args ($) { confess "Passed resultsource has no record of the supplied rel_name - likely wrong \$rsrc" unless ref $args->{self_resultsource}->relationship_info($args->{rel_name}); - my $rowobj_cnt = 0; + my $struct_cnt = 0; if (defined $args->{self_result_object} or defined $args->{self_rowobj} ) { - $rowobj_cnt++; + $struct_cnt++; for (qw(self_result_object self_rowobj)) { confess "Custom condition argument '$_' must be a result instance" unless defined blessed $args->{$_} and $args->{$_}->isa('DBIx::Class::Row'); @@ -112,15 +112,15 @@ sub check_customcond_args ($) { if refaddr($args->{self_result_object}) != refaddr($args->{self_rowobj}); } - if (defined $args->{foreign_result_object}) { - $rowobj_cnt++; + if (defined $args->{foreign_values}) { + $struct_cnt++; - confess "Custom condition argument 'foreign_result_object' must be a result instance" - unless defined blessed $args->{foreign_result_object} and $args->{foreign_result_object}->isa('DBIx::Class::Row'); + confess "Custom condition argument 'foreign_values' must be a hash reference" + unless ref $args->{foreign_values} eq 'HASH'; } - confess "Result objects supplied on both ends of a relationship" - if $rowobj_cnt == 2; + confess "Data structures supplied on both ends of a relationship" + if $struct_cnt == 2; $args; }