Lines 262-279
subtest '->is_paged and ->pager tests' => sub {
Link Here
|
262 |
|
262 |
|
263 |
$schema->storage->txn_begin; |
263 |
$schema->storage->txn_begin; |
264 |
|
264 |
|
265 |
# Delete existing patrons |
265 |
# Count existing patrons |
266 |
t::lib::Mocks::mock_preference('AnonymousPatron', ''); |
266 |
my $nb_patrons = Koha::Patrons->search()->count; |
267 |
Koha::Checkouts->delete; |
267 |
# Create 10 more patrons |
268 |
Koha::Patrons->delete; |
|
|
269 |
# Create 10 patrons |
270 |
foreach (1..10) { |
268 |
foreach (1..10) { |
271 |
$builder->build_object({ class => 'Koha::Patrons' }); |
269 |
$builder->build_object({ class => 'Koha::Patrons' }); |
272 |
} |
270 |
} |
273 |
|
271 |
|
274 |
# Non-paginated search |
272 |
# Non-paginated search |
275 |
my $patrons = Koha::Patrons->search(); |
273 |
my $patrons = Koha::Patrons->search(); |
276 |
is( $patrons->count, 10, 'Search returns all patrons' ); |
274 |
is( $patrons->count, $nb_patrons + 10, 'Search returns all patrons' ); |
277 |
ok( !$patrons->is_paged, 'Search is not paged' ); |
275 |
ok( !$patrons->is_paged, 'Search is not paged' ); |
278 |
|
276 |
|
279 |
# Paginated search |
277 |
# Paginated search |
280 |
- |
|
|