Bugzilla – Attachment 54529 Details for
Bug 16272
Transform checkout from on-site checkout to regular checkout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16272: Add description for tests
Bug-16272-Add-description-for-tests.patch (text/plain), 3.71 KB, created by
Nick Clemens (kidclamp)
on 2016-08-16 18:16:51 UTC
(
hide
)
Description:
Bug 16272: Add description for tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-08-16 18:16:51 UTC
Size:
3.71 KB
patch
obsolete
>From 230f2c8e0228335dc89dfda44f6bb5538fb2fb9e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 16 Aug 2016 16:59:38 +0100 >Subject: [PATCH] Bug 16272: Add description for tests > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Circulation/SwitchOnSiteCheckouts.t | 21 +++++++++++---------- > 1 file changed, 11 insertions(+), 10 deletions(-) > >diff --git a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t b/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t >index 5a46a20..d8df911 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 => 8; >+use Test::More tests => 9; > use C4::Context; > > use C4::Biblio; >@@ -94,16 +94,17 @@ C4::Circulation::AddIssue( $patron, $item->{barcode}, dt_from_string, undef, dt_ > my ( $impossible, $messages ); > t::lib::Mocks::mock_preference('SwitchOnSiteCheckouts', 0); > ( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $item->{barcode} ); >-is( $impossible->{NO_RENEWAL_FOR_ONSITE_CHECKOUTS}, 1, '' ); >+is( $impossible->{NO_RENEWAL_FOR_ONSITE_CHECKOUTS}, 1, 'Do not renew on-site checkouts' ); > > t::lib::Mocks::mock_preference('SwitchOnSiteCheckouts', 1); >-( undef, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $item->{barcode} ); >-is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, '' ); >+( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $item->{barcode} ); >+is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, 'If SwitchOnSiteCheckouts, switch the on-site checkout' ); >+is( exists $impossible->{TOO_MANY}, '', 'If SwitchOnSiteCheckouts, switch the on-site checkout' ); > C4::Circulation::AddIssue( $patron, $item->{barcode}, undef, undef, undef, undef, { switch_onsite_checkout => 1 } ); > my $issue = C4::Circulation::GetItemIssue( $item->{itemnumber} ); >-is( $issue->{onsite_checkout}, 0, '' ); >+is( $issue->{onsite_checkout}, 0, 'The issue should have been switched to a regular checkout' ); > my $five_days_after = dt_from_string->add( days => 5 )->set( hour => 23, minute => 59, second => 0 ); >-is( $issue->{date_due}, $five_days_after ); >+is( $issue->{date_due}, $five_days_after, 'The date_due should have been set depending on the circ rules when the on-site checkout has been switched' ); > > # Specific case > t::lib::Mocks::mock_preference('ConsiderOnSiteCheckoutsAsNormalCheckouts', 1); >@@ -118,8 +119,8 @@ my $another_item = $builder->build({ > > C4::Circulation::AddIssue( $patron, $another_item->{barcode}, dt_from_string, undef, dt_from_string, undef, { onsite_checkout => 1 } ); > ( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $another_item->{barcode} ); >-is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, '' ); >-is( exists $impossible->{TOO_MANY}, '', '' ); >+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' ); > > $dbh->do(q|DELETE FROM issuingrules|); > my $borrower_circ_rule = $builder->build({ >@@ -132,8 +133,8 @@ my $borrower_circ_rule = $builder->build({ > }, > }); > ( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $another_item->{barcode} ); >-is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, '' ); >-is( exists $impossible->{TOO_MANY}, '', '' ); >+is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, 'Specific case 2 - Switch is allowed' ); >+is( exists $impossible->{TOO_MANY}, '', 'Specific case 2 - Switch is allowed' ); > > $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 16272
:
50606
|
50607
|
51331
|
51332
|
51333
|
54498
|
54499
|
54523
|
54524
|
54526
|
54527
|
54528
| 54529 |
54579
|
54580