5 eval "use DBIx::Class::CDBICompat;";
7 plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required');
10 eval "use DBD::SQLite";
11 plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 6);
14 use lib 't/cdbi/testlib';
18 Film->create({ Title => 'Film 1' }),
19 Film->create({ Title => 'Film 2' }),
20 Film->create({ Title => 'Film 3' }),
21 Film->create({ Title => 'Film 4' }),
22 Film->create({ Title => 'Film 5' }),
26 my ( $pager, $it ) = Film->page(
32 is( $pager->entries_on_this_page, 3, "entries_on_this_page ok" );
34 is( $pager->next_page, 2, "next_page ok" );
36 is( $it->next->title, "Film 1", "iterator->next ok" );
41 is( $it->next, undef, "next past end of page ok" );
44 ( $pager, $it ) = Film->page(
50 is( $pager->entries_on_this_page, 2, "entries on second page ok" );
52 is( $it->next->title, "Film 4", "second page first title ok" );