7 eval "use DBIx::Class::CDBICompat;";
9 plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required');
12 eval "use DBD::SQLite";
13 plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 10);
18 use_ok('DBICTest::HelperRels');
20 DBICTest::CD->load_components(qw/CDBICompat::Pager/);
22 my ( $pager, $it ) = DBICTest::CD->page(
24 { order_by => 'title',
28 cmp_ok( $pager->entries_on_this_page, '==', 3, "entries_on_this_page ok" );
30 cmp_ok( $pager->next_page, '==', 2, "next_page ok" );
32 is( $it->next->title, "Caterwaulin' Blues", "iterator->next ok" );
37 is( $it->next, undef, "next past end of page ok" );
39 ( $pager, $it ) = DBICTest::CD->page(
43 disable_sql_paging => 1 } );
45 cmp_ok( $pager->total_entries, '==', 5, "disable_sql_paging total_entries ok" );
47 cmp_ok( $pager->previous_page, '==', 1, "disable_sql_paging previous_page ok" );
49 is( $it->next->title, "Caterwaulin' Blues", "disable_sql_paging iterator->next ok" );
53 is( $it->next, undef, "disable_sql_paging next past end of page ok" );
55 # based on a failing criteria submitted by waswas
56 ( $pager, $it ) = DBICTest::CD->page(
63 -not_like => 'Forkful%'
69 is( $it->count, 1, "complex abstract count ok" );