sub AUTOLOAD {
my ( $self, @params ) = @_;
- my @known_methods = qw( count pager update delete result_class single slice );
+ my @known_methods = qw( count is_paged pager update delete result_class single slice );
my $method = our $AUTOLOAD;
$method =~ s/.*:://;
use Modern::Perl;
-use Test::More tests => 15;
+use Test::More tests => 16;
use Test::Warn;
use Koha::Authority::Types;
};
$schema->storage->txn_rollback;
+
+subtest '->is_paged tests' => sub {
+
+ plan tests => 2;
+
+ $schema->storage->txn_begin;
+
+ foreach (1..10) {
+ $builder->build_object({ class => 'Koha::Patrons' });
+ }
+
+ my $patrons = Koha::Patrons->search();
+ ok( !$patrons->is_paged, 'Search is not paged' );
+ $patrons = Koha::Patrons->search( undef, { 'page' => 1, 'rows' => 3 } );
+ ok( $patrons->is_paged, 'Search is paged' );
+
+ $schema->storage->txn_rollback;
+}