Bugzilla – Attachment 40411 Details for
Bug 13030
Show hold expiration date for waiting holds on circulation.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13030 [QA Followup] - Fix unit testsBug 13030 [QA Followup] - Fix unit tests
Bug-13030-QA-Followup---Fix-unit-testsBug-13030-QA.patch (text/plain), 2.00 KB, created by
Kyle M Hall (khall)
on 2015-06-19 15:33:11 UTC
(
hide
)
Description:
Bug 13030 [QA Followup] - Fix unit testsBug 13030 [QA Followup] - Fix unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-06-19 15:33:11 UTC
Size:
2.00 KB
patch
obsolete
>From 19ca161457923835578057ce7f86b2280a352ed0 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 18 Jun 2015 20:50:53 -0400 >Subject: [PATCH] Bug 13030 [QA Followup] - Fix unit testsBug 13030 [QA Followup] - Fix unit tests > >--- > t/{ => db_dependent}/Hold.t | 27 +++++++++++++-------------- > 1 files changed, 13 insertions(+), 14 deletions(-) > rename t/{ => db_dependent}/Hold.t (78%) > >diff --git a/t/Hold.t b/t/db_dependent/Hold.t >similarity index 78% >rename from t/Hold.t >rename to t/db_dependent/Hold.t >index 6594c56..0aa7076 100755 >--- a/t/Hold.t >+++ b/t/db_dependent/Hold.t >@@ -17,29 +17,26 @@ > > use Modern::Perl; > >-use Test::MockModule; >+use C4::Context; >+use Koha::Database; >+ > use Test::More tests => 5; >-use t::lib::Mocks; >- >-my $module = new Test::MockModule('C4::Context'); >-$module->mock( >- '_new_dbh', >- sub { >- my $dbh = DBI->connect( 'DBI:Mock:', '', '' ) >- || die "Cannot create handle: $DBI::errstr\n"; >- return $dbh; >- } >-); > > use_ok('Koha::Hold'); > >+my $schema = Koha::Database->new()->schema(); >+$schema->storage->txn_begin(); >+ >+my $dbh = C4::Context->dbh; >+$dbh->{RaiseError} = 1; >+ > my $hold = Koha::Hold->new({ found => 'W', waitingdate => '2000-01-01'}); > >-t::lib::Mocks::mock_preference('ReservesMaxPickUpDelay', undef); >+C4::Context->set_preference( 'ReservesMaxPickUpDelay', '' ); > my $dt = $hold->waiting_expires_on(); > is( $dt, undef, "Koha::Hold->waiting_expires_on returns undef if ReservesMaxPickUpDelay is not set"); > >-t::lib::Mocks::mock_preference('ReservesMaxPickUpDelay', 5); >+C4::Context->set_preference( 'ReservesMaxPickUpDelay', '5' ); > $dt = $hold->waiting_expires_on(); > is( $dt->ymd, "2000-01-06", "Koha::Hold->waiting_expires_on returns DateTime of waitingdate + ReservesMaxPickUpDelay if set"); > >@@ -51,4 +48,6 @@ $hold->found(q{}); > $dt = $hold->waiting_expires_on(); > is( $dt, undef, "Koha::Hold->waiting_expires_on returns undef if found is not 'W' ( Set to empty string )"); > >+$schema->storage->txn_rollback(); >+ > 1; >-- >1.7.2.5
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 13030
:
32012
|
32070
|
32935
|
40027
|
40038
|
40411
|
40412
|
40414
|
40415