Bugzilla – Attachment 61759 Details for
Bug 18321
One more checkouts possible than allowed by rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18321: Add tests
Bug-18321-Add-tests.patch (text/plain), 2.98 KB, created by
Jonathan Druart
on 2017-03-31 17:50:51 UTC
(
hide
)
Description:
Bug 18321: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-03-31 17:50:51 UTC
Size:
2.98 KB
patch
obsolete
>From c73ef3922873e3ebb952297a78f760f6e286da2b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 31 Mar 2017 00:23:19 -0300 >Subject: [PATCH] Bug 18321: Add tests > >Clean a bit existing tests by adding default values and add a test to >highlight the issue. >--- > t/db_dependent/Circulation/SwitchOnSiteCheckouts.t | 25 +++++++++++++++++++++- > 1 file changed, 24 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t b/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t >index 024801e..7b77e9c 100644 >--- a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t >+++ b/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t >@@ -15,7 +15,7 @@ > # with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 9; >+use Test::More tests => 10; > use C4::Context; > > use C4::Biblio; >@@ -53,6 +53,7 @@ my $patron = $builder->build({ > source => 'Borrower', > value => { > branchcode => $branch->{branchcode}, >+ debarred => undef, > }, > }); > >@@ -68,6 +69,9 @@ my $item = $builder->build({ > biblionumber => $biblio->{biblionumber}, > homebranch => $branch->{branchcode}, > holdingbranch => $branch->{branchcode}, >+ notforloan => 0, >+ withdrawn => 0, >+ lost => 0, > }, > }); > >@@ -87,6 +91,8 @@ my $issuingrule = $builder->build({ > C4::Context->_new_userenv ('DUMMY_SESSION_ID'); > C4::Context->set_userenv($patron->{borrowernumber}, $patron->{userid}, 'usercnum', 'First name', 'Surname', $branch->{branchcode}, 'My Library', 0); > >+t::lib::Mocks::mock_preference('AllowTooManyOverride', 0); >+ > # Add onsite checkout > C4::Circulation::AddIssue( $patron, $item->{barcode}, dt_from_string, undef, dt_from_string, undef, { onsite_checkout => 1 } ); > >@@ -113,6 +119,9 @@ my $another_item = $builder->build({ > biblionumber => $biblio->{biblionumber}, > homebranch => $branch->{branchcode}, > holdingbranch => $branch->{branchcode}, >+ notforloan => 0, >+ withdrawn => 0, >+ lost => 0, > }, > }); > >@@ -121,6 +130,20 @@ C4::Circulation::AddIssue( $patron, $another_item->{barcode}, dt_from_string, un > is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, 'Specific case 1 - Switch is allowed' ); > is( exists $impossible->{TOO_MANY}, '', 'Specific case 1 - Switch is allowed' ); > >+my $yet_another_item = $builder->build({ >+ source => 'Item', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ homebranch => $branch->{branchcode}, >+ holdingbranch => $branch->{branchcode}, >+ notforloan => 0, >+ withdrawn => 0, >+ lost => 0, >+ }, >+}); >+( $impossible, undef, undef, undef ) = C4::Circulation::CanBookBeIssued( $patron, $yet_another_item->{barcode} ); >+is( $impossible->{TOO_MANY}, 'TOO_MANY_CHECKOUTS', 'Not a specific case, $delta should not be incremented' ); >+ > $dbh->do(q|DELETE FROM issuingrules|); > my $borrower_circ_rule = $builder->build({ > source => 'DefaultCircRule', >-- >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 18321
:
61588
|
61646
|
61759
|
61760
|
61770
|
61771
|
62076
|
62077