Bugzilla – Attachment 66683 Details for
Bug 19209
Koha::Objects should provide ->is_paged method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19209: Add ->is_paged method to Koha::Objects
Bug-19209-Add--ispaged-method-to-KohaObjects.patch (text/plain), 2.26 KB, created by
Marcel de Rooy
on 2017-09-01 05:57:29 UTC
(
hide
)
Description:
Bug 19209: Add ->is_paged method to Koha::Objects
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-09-01 05:57:29 UTC
Size:
2.26 KB
patch
obsolete
>From 5fb6611dbabfd91ef6bfd48f2438bdb6ed56b6c0 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 30 Aug 2017 12:09:37 -0300 >Subject: [PATCH] Bug 19209: Add ->is_paged method to Koha::Objects >Content-Type: text/plain; charset=utf-8 > >This patch adds ->is_paged to Koha::Objects. It is inherited from the underlying resultset >from DBIC so there's no code besides adding it to the known methods in AUTOLOAD. > >Tests are added for the newly exported method. > >To test: >- Apply this patch >- Run: > $ sudo koha-shell kohadev > k$ cd kohaclone > k$ prove t/db_dependent/Koha/Objects.t >=> SUCCESS: Tests pass! >- Sign off :-D > >Sponsored-by: Camden County > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Objects.pm | 2 +- > t/db_dependent/Koha/Objects.t | 20 +++++++++++++++++++- > 2 files changed, 20 insertions(+), 2 deletions(-) > >diff --git a/Koha/Objects.pm b/Koha/Objects.pm >index 193e494..8c79afd 100644 >--- a/Koha/Objects.pm >+++ b/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/.*:://; > >diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t >index c05afc3..b382ce1 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 => 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; >+} >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19209
:
66620
|
66627
|
66631
|
66632
|
66633
| 66683 |
66684
|
66685