Fix incorrect cond construction in _minimal_valueset_satisfying_constraint
[dbsrgits/DBIx-Class.git] / t / 60core.t
index 3a674de..f92159b 100644 (file)
@@ -5,8 +5,7 @@ use Test::More;
 use Test::Exception;
 use Test::Warn;
 use lib qw(t/lib);
-use DBICTest;
-use DBIC::SqlMakerTest;
+use DBICTest ':DiffSQL';
 
 my $schema = DBICTest->init_schema();
 
@@ -131,6 +130,13 @@ throws_ok {
 
 is($schema->resultset("Artist")->count, 4, 'count ok');
 
+# test find on an unresolvable condition
+is(
+  $schema->resultset('Artist')->find({ artistid => [ -and => 1, 2 ]}),
+  undef
+);
+
+
 # test find_or_new
 {
   my $existing_obj = $schema->resultset('Artist')->find_or_new({
@@ -243,7 +249,7 @@ is($schema->class("Artist")->field_name_for->{name}, 'artist name', 'mk_classdat
 
 my $search = [ { 'tags.tag' => 'Cheesy' }, { 'tags.tag' => 'Blue' } ];
 
-my( $or_rs ) = $schema->resultset("CD")->search_rs($search, { join => 'tags',
+my $or_rs = $schema->resultset("CD")->search_rs($search, { join => 'tags',
                                                   order_by => 'cdid' });
 is($or_rs->all, 5, 'Joined search with OR returned correct number of rows');
 is($or_rs->count, 5, 'Search count with OR ok');
@@ -292,7 +298,7 @@ is ($collapsed_or_rs->count, 4, 'Collapsed search count with OR ok');
 my $tag_rs = $schema->resultset('Tag')->search(
                [ { 'me.tag' => 'Cheesy' }, { 'me.tag' => 'Blue' } ]);
 
-my $rel_rs = $tag_rs->search_related('cd');
+my $rel_rs = $tag_rs->search_related('cd', {}, { order_by => 'cd.cdid'} );
 
 is($rel_rs->count, 5, 'Related search ok');