X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fbind%2Fattribute.t;h=ca00c30d6db35d361a4e6e7e811f182277c07a97;hb=184005983ab22b5cf557191542d8d18c114176aa;hp=1a1d0c7d7616778492df807537715eb97fe0947d;hpb=b8b55c8e07c18335fac0354541884294fb70f322;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/bind/attribute.t b/t/bind/attribute.t index 1a1d0c7..ca00c30 100644 --- a/t/bind/attribute.t +++ b/t/bind/attribute.t @@ -9,13 +9,6 @@ use_ok('DBICTest'); my $schema = DBICTest->init_schema; -BEGIN { - eval "use DBD::SQLite"; - plan $@ - ? ( skip_all => 'needs DBD::SQLite for testing' ) - : ( tests => 13 ); -} - my $where_bind = { where => \'name like ?', bind => [ 'Cat%' ], @@ -38,7 +31,7 @@ TODO: { ->search({ artistid => 1}); is ( $rs->count, 1, 'where/bind first' ); - + $rs = $schema->resultset('Artist')->search({ artistid => 1}) ->search({}, $where_bind); @@ -76,7 +69,7 @@ TODO: { $rs = $schema->resultset('Complex')->search({}, { bind => [ 1999 ] })->search({}, { where => \"title LIKE ?", bind => [ 'Spoon%' ] }); is_same_sql_bind( $rs->as_query, - "(SELECT me.artistid, me.name, me.rank, me.charfield FROM (SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year FROM artist a JOIN cd ON cd.artist = a.artistid WHERE cd.year = ?) WHERE title LIKE ?)", + "(SELECT me.artistid, me.name, me.rank, me.charfield FROM (SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year FROM artist a JOIN cd ON cd.artist = a.artistid WHERE cd.year = ?) me WHERE title LIKE ?)", [ [ '!!dummy' => '1999' ], [ '!!dummy' => 'Spoon%' ] @@ -105,7 +98,7 @@ TODO: { $rs = $schema->resultset('CustomSql')->search({}, { bind => [ 1999 ] })->search({}, { where => \"title LIKE ?", bind => [ 'Spoon%' ] }); is_same_sql_bind( $rs->as_query, - "(SELECT me.artistid, me.name, me.rank, me.charfield FROM (SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year FROM artist a JOIN cd ON cd.artist = a.artistid WHERE cd.year = ?) WHERE title LIKE ?)", + "(SELECT me.artistid, me.name, me.rank, me.charfield FROM (SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year FROM artist a JOIN cd ON cd.artist = a.artistid WHERE cd.year = ?) me WHERE title LIKE ?)", [ [ '!!dummy' => '1999' ], [ '!!dummy' => 'Spoon%' ] @@ -122,3 +115,5 @@ TODO: { bind => [ 'Spoon%' ] }); is ( $rs->count, 1, '...cookbook + chained search with extra bind' ); } + +done_testing;