From 7a23134f2d36e2ad99054c5a723ac1c663d3595d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 9 Aug 2016 15:54:58 +0100 Subject: [PATCH] Bug 17091: Remove explicit declaration of Koha::Objects->pager Test plan: prove t/db_dependent/Koha/Objects.t should return green Signed-off-by: Hector Castro Signed-off-by: Kyle M Hall --- Koha/Objects.pm | 11 ----------- t/db_dependent/Koha/Objects.t | 8 +++++++- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Koha/Objects.pm b/Koha/Objects.pm index 0dba0e01..a1ee20d 100644 --- a/Koha/Objects.pm +++ b/Koha/Objects.pm @@ -130,17 +130,6 @@ sub search { } } -=head3 Koha::Objects->pager(); - -my $pager = Koha::Objects->pager; - -=cut - -sub pager { - my ( $self ) = @_; - return $self->_resultset->pager; -} - =head3 Koha::Objects->next(); my $object = Koha::Objects->next(); diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t index 3551caa..bb75747 100644 --- a/t/db_dependent/Koha/Objects.t +++ b/t/db_dependent/Koha/Objects.t @@ -19,7 +19,7 @@ use Modern::Perl; -use Test::More tests => 3; +use Test::More tests => 4; use Koha::Authority::Types; use Koha::Cities; @@ -51,5 +51,11 @@ subtest 'update' => sub { is( Koha::Cities->search( { city_country => 'UK' } )->count, 0, 'Koha::Objects->update should have updated the 3 rows' ); }; +subtest 'pager' => sub { + plan tests => 1; + my $pager = Koha::Patrons->search( {}, { page => 1, rows => 2 } )->pager; + is( ref($pager), 'DBIx::Class::ResultSet::Pager', 'Koha::Objects->pager returns a valid DBIx::Class object' ); +}; + $schema->storage->txn_rollback; 1; -- 2.1.4