Bugzilla – Attachment 66627 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: (QA followup) Improve tests
Bug-19209-QA-followup-Improve-tests.patch (text/plain), 2.28 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-08-30 15:32:40 UTC
(
hide
)
Description:
Bug 19209: (QA followup) Improve tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-08-30 15:32:40 UTC
Size:
2.28 KB
patch
obsolete
>From 599bb346216d5988e3933f7806a7ceb5542bdd12 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 30 Aug 2017 12:30:05 -0300 >Subject: [PATCH] Bug 19209: (QA followup) Improve tests > >This path merges the pager() test and adds search results count tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Objects.t | 23 ++++++++++++++--------- > 1 file changed, 14 insertions(+), 9 deletions(-) > >diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t >index b382ce1..069c2c8 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 => 16; >+use Test::More tests => 15; > use Test::Warn; > > use Koha::Authority::Types; >@@ -74,12 +74,6 @@ 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' ); >-}; >- > subtest 'reset' => sub { > plan tests => 3; > >@@ -215,20 +209,31 @@ subtest 'Exceptions' => sub { > > $schema->storage->txn_rollback; > >-subtest '->is_paged tests' => sub { >+subtest '->is_paged and ->pager tests' => sub { > >- plan tests => 2; >+ plan tests => 5; > > $schema->storage->txn_begin; > >+ # Delete existing patrons >+ Koha::Patrons->search->delete; >+ # Create 10 patrons > foreach (1..10) { > $builder->build_object({ class => 'Koha::Patrons' }); > } > >+ # Non-paginated search > my $patrons = Koha::Patrons->search(); >+ is( $patrons->count, 10, 'Search returns all patrons' ); > ok( !$patrons->is_paged, 'Search is not paged' ); >+ >+ # Paginated search > $patrons = Koha::Patrons->search( undef, { 'page' => 1, 'rows' => 3 } ); >+ is( $patrons->count, 3, 'Search returns only one page, 3 patrons' ); > ok( $patrons->is_paged, 'Search is paged' ); >+ my $pager = $patrons->pager; >+ is( ref($patrons->pager), 'DBIx::Class::ResultSet::Pager', >+ 'Koha::Objects->pager returns a valid DBIx::Class object' ); > > $schema->storage->txn_rollback; > } >-- >2.7.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