Bugzilla – Attachment 91416 Details for
Bug 23281
Add Koha::Objects::Limit::Library
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23281: Implement ->search_with_library_limits in Koha::Patron::Attribute::Types
Bug-23281-Implement--searchwithlibrarylimits-in-Ko.patch (text/plain), 2.68 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-07-08 18:25:09 UTC
(
hide
)
Description:
Bug 23281: Implement ->search_with_library_limits in Koha::Patron::Attribute::Types
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-07-08 18:25:09 UTC
Size:
2.68 KB
patch
obsolete
>From 299779cf54e773ad4fdbbe0eb097b6a872034f6e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 8 Jul 2019 14:15:48 -0300 >Subject: [PATCH] Bug 23281: Implement ->search_with_library_limits in > Koha::Patron::Attribute::Types > >This patch makes Koha::Patron::Attribute::Types inherit from >Koha::Objects::Limit::Library so it now has the >->search_with_library_limits method. > >Tests are adjusted so it is clear that there is no behaviour change >compared to the (previsouly) called ->search > >To test: >- Run: > k$ prove t/db_dependent/Koha/Patron/Attribute/Types.t >=> SUCCESS: Tests pass! >- Apply this patch >- Run: > k$ prove t/db_dependent/Koha/Patron/Attribute/Types.t >=> SUCCESS: Tests still pass! >- Sign off :-D >--- > Koha/Patron/Attribute/Types.pm | 2 +- > t/db_dependent/Koha/Patron/Attribute/Types.t | 16 +++++----------- > 2 files changed, 6 insertions(+), 12 deletions(-) > >diff --git a/Koha/Patron/Attribute/Types.pm b/Koha/Patron/Attribute/Types.pm >index c32eb015a7..5064fd2479 100644 >--- a/Koha/Patron/Attribute/Types.pm >+++ b/Koha/Patron/Attribute/Types.pm >@@ -19,7 +19,7 @@ use Modern::Perl; > > use Koha::Patron::Attribute::Type; > >-use base qw(Koha::Objects); >+use base qw(Koha::Objects Koha::Objects::Limit::Library); > > =head1 NAME > >diff --git a/t/db_dependent/Koha/Patron/Attribute/Types.t b/t/db_dependent/Koha/Patron/Attribute/Types.t >index 80378c594d..8c49a45474 100644 >--- a/t/db_dependent/Koha/Patron/Attribute/Types.t >+++ b/t/db_dependent/Koha/Patron/Attribute/Types.t >@@ -287,7 +287,7 @@ subtest 'replace_library_limits() tests' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'search() with branch limits tests' => sub { >+subtest 'search_with_library_limits() tests' => sub { > > plan tests => 3; > >@@ -322,16 +322,10 @@ subtest 'search() with branch limits tests' => sub { > $object_code_2->library_limits( [$branch_2] ); > $object_code_3->library_limits( [ $branch_1, $branch_2 ] ); > >- is( Koha::Patron::Attribute::Types->search( { branchcode => $branch_1 } ) >- ->count, >- 3, >- '3 attribute types are available for the specified branch' >- ); >- is( Koha::Patron::Attribute::Types->search( { branchcode => $branch_2 } ) >- ->count, >- 3, >- '3 attribute types are available for the specified branch' >- ); >+ is( Koha::Patron::Attribute::Types->search_with_library_limits( {}, {}, $branch_1 )->count, >+ 3, '3 attribute types are available for the specified branch' ); >+ is( Koha::Patron::Attribute::Types->search_with_library_limits( {}, {}, $branch_2 )->count, >+ 3, '3 attribute types are available for the specified branch' ); > > $schema->storage->txn_rollback; > }; >-- >2.22.0
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 23281
:
91415
|
91416
|
91417
|
91459
|
91460
|
91461
|
92337
|
92338
|
92339