Bugzilla – Attachment 70109 Details for
Bug 19301
Move C4::Reserves::OnShelfHoldsAllowed to the Koha namespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19301: (QA follow-up) Add a few simple tests
Bug-19301-QA-follow-up-Add-a-few-simple-tests.patch (text/plain), 2.01 KB, created by
Marcel de Rooy
on 2017-12-22 09:34:13 UTC
(
hide
)
Description:
Bug 19301: (QA follow-up) Add a few simple tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-12-22 09:34:13 UTC
Size:
2.01 KB
patch
obsolete
>From a5061e0a29e06910ad8eb75b6d1f7070f698a83b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 22 Dec 2017 10:08:07 +0100 >Subject: [PATCH] Bug 19301: (QA follow-up) Add a few simple tests >Content-Type: text/plain; charset=utf-8 > >We removed tests from Reserves.t, but would be nice to test the new >sub in IssuingRules.t too. >Adding a subtest there. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Koha/IssuingRules.t | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/IssuingRules.t b/t/db_dependent/Koha/IssuingRules.t >index b1c97bf..66e2836 100644 >--- a/t/db_dependent/Koha/IssuingRules.t >+++ b/t/db_dependent/Koha/IssuingRules.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 2; >+use Test::More tests => 3; > > use Benchmark; > >@@ -290,6 +290,22 @@ subtest 'get_opacitemholds_policy' => sub { > $patron->delete; > }; > >+subtest 'get_onshelfholds_policy' => sub { >+ plan tests => 3; >+ >+ t::lib::Mocks::mock_preference('item-level_itypes', 1); >+ Koha::IssuingRules->delete; >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $item = $builder->build_object({ class => 'Koha::Items' }); >+ >+ is( Koha::IssuingRules->get_onshelfholds_policy({ item => $item, patron => $patron }), undef, 'Should return undef when no rules can be found' ); >+ Koha::IssuingRule->new({ categorycode => $patron->categorycode, itemtype => $item->itype, branchcode => '*', onshelfholds => "0" })->store; >+ is( Koha::IssuingRules->get_onshelfholds_policy({ item => $item, patron => $patron }), 0, 'Should be zero' ); >+ Koha::IssuingRule->new({ categorycode => $patron->categorycode, itemtype => $item->itype, branchcode => $item->holdingbranch, onshelfholds => "2" })->store; >+ is( Koha::IssuingRules->get_onshelfholds_policy({ item => $item, patron => $patron }), 2, 'Should be two now' ); >+}; >+ > sub _row_match { > my ($rule, $branchcode, $categorycode, $itemtype) = @_; > >-- >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 19301
:
67122
|
67123
|
67420
|
67421
|
69846
|
69847
|
70106
|
70107
|
70108
| 70109