@@ -, +, @@ - Apply this patch - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/Koha/Objects.t - Sign off :-D --- Koha/Objects.pm | 2 +- t/db_dependent/Koha/Objects.t | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) --- a/Koha/Objects.pm +++ a/Koha/Objects.pm @@ -379,7 +379,7 @@ Currently count, pager, update and delete are covered. 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/.*:://; --- a/t/db_dependent/Koha/Objects.t +++ a/t/db_dependent/Koha/Objects.t @@ -19,7 +19,7 @@ use Modern::Perl; -use Test::More tests => 15; +use Test::More tests => 16; use Test::Warn; use Koha::Authority::Types; @@ -214,3 +214,21 @@ subtest 'Exceptions' => sub { }; $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; +} --