X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fresultset%2Fbind_attr.t;h=a636cfc1533a62018e5bb8c8e0a4ba63fb672dd9;hb=6c7ca96253b07f8ac9b6940ac35368d25ed3b139;hp=af970204d8d127772b74c6c643bce9aeaa8b5df3;hpb=ea20ead00a56006b5dd6353bdd22c1eed775f864;p=dbsrgits%2FDBIx-Class.git diff --git a/t/resultset/bind_attr.t b/t/resultset/bind_attr.t index af97020..a636cfc 100644 --- a/t/resultset/bind_attr.t +++ b/t/resultset/bind_attr.t @@ -1,11 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); -use DBIC::SqlMakerTest; -use_ok('DBICTest'); +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema; @@ -16,9 +16,7 @@ my $where_bind = { my $rs; -TODO: { - local $TODO = 'bind args order needs fixing (semifor)'; - +{ # First, the simple cases... $rs = $schema->resultset('Artist')->search( { artistid => 1 }, @@ -36,6 +34,13 @@ TODO: { ->search({}, $where_bind); is ( $rs->count, 1, 'where/bind last' ); + + # and the complex case + $rs = $schema->resultset('CustomSql')->search({}, { bind => [ 1999 ] }) + ->search({ 'artistid' => 1 }, { + where => \'title like ?', + bind => [ 'Spoon%' ] }); + is ( $rs->count, 1, '...cookbook + chained search with extra bind' ); } { @@ -107,13 +112,4 @@ TODO: { ); } -TODO: { - local $TODO = 'bind args order needs fixing (semifor)'; - $rs = $schema->resultset('Complex')->search({}, { bind => [ 1999 ] }) - ->search({ 'artistid' => 1 }, { - where => \'title like ?', - bind => [ 'Spoon%' ] }); - is ( $rs->count, 1, '...cookbook + chained search with extra bind' ); -} - done_testing;