X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frun%2F15limit.tl;h=eca720d3feb1d1a88b107684a35a9a2bc0655285;hb=86efc7500ca480dbdc2f2b9765130e419640fde0;hp=4137377759868c8dfa28f3b44a429d4fb40d7697;hpb=3712e4f41b929456d8fad713ca702e4a48e9a940;p=dbsrgits%2FDBIx-Class.git diff --git a/t/run/15limit.tl b/t/run/15limit.tl index 4137377..eca720d 100644 --- a/t/run/15limit.tl +++ b/t/run/15limit.tl @@ -1,4 +1,5 @@ sub run_tests { +my $schema = shift; BEGIN { eval "use DBD::SQLite"; @@ -6,7 +7,7 @@ BEGIN { } # test LIMIT -my $it = DBICTest->class("CD")->search( {}, +my $it = $schema->resultset("CD")->search( {}, { rows => 3, order_by => 'title' } ); @@ -17,7 +18,7 @@ $it->next; is( $it->next, undef, "next past end of resultset ok" ); # test OFFSET -my @cds = DBICTest->class("CD")->search( {}, +my @cds = $schema->resultset("CD")->search( {}, { rows => 2, offset => 2, order_by => 'year' } @@ -25,7 +26,7 @@ my @cds = DBICTest->class("CD")->search( {}, is( $cds[0]->title, "Spoonful of bees", "offset ok" ); # test software-based limiting -$it = DBICTest->class("CD")->search( {}, +$it = $schema->resultset("CD")->search( {}, { rows => 3, software_limit => 1, order_by => 'title' } @@ -36,7 +37,7 @@ $it->next; $it->next; is( $it->next, undef, "software next past end of resultset ok" ); -@cds = DBICTest->class("CD")->search( {}, +@cds = $schema->resultset("CD")->search( {}, { rows => 2, offset => 2, software_limit => 1, @@ -46,7 +47,7 @@ is( $cds[0]->title, "Spoonful of bees", "software offset ok" ); # based on a failing criteria submitted by waswas # requires SQL::Abstract >= 1.20 -$it = DBICTest->class("CD")->search( +$it = $schema->resultset("CD")->search( { title => [ -and => {