Bugzilla – Attachment 40257 Details for
Bug 13851
Replace waiting holds logic in circulation.pl with Koha Objects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13851 [QA Followup] - Unit Tests
Bug-13851-QA-Followup---Unit-Tests.patch (text/plain), 2.25 KB, created by
Jonathan Druart
on 2015-06-18 08:50:51 UTC
(
hide
)
Description:
Bug 13851 [QA Followup] - Unit Tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-06-18 08:50:51 UTC
Size:
2.25 KB
patch
obsolete
>From 5a753b2f922e15b687a990fe52c1a4fa92b87c4b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 16 Jun 2015 22:53:10 -0400 >Subject: [PATCH] Bug 13851 [QA Followup] - Unit Tests > >Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> >--- > t/db_dependent/Holds.t | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 5a480d8..01e67db 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -6,13 +6,15 @@ use t::lib::Mocks; > use C4::Context; > use C4::Branch; > >-use Test::More tests => 41; >+use Test::More tests => 49; > use MARC::Record; > use C4::Biblio; > use C4::Items; > use C4::Members; > use C4::Calendar; > >+use Koha::Holds; >+ > use Koha::DateUtils qw( dt_from_string output_pref ); > > BEGIN { >@@ -30,6 +32,7 @@ $dbh->{RaiseError} = 1; > my $borrowers_count = 5; > > $dbh->do('DELETE FROM itemtypes'); >+$dbh->do('DELETE FROM reserves'); > my $insert_sth = $dbh->prepare('INSERT INTO itemtypes (itemtype) VALUES (?)'); > $insert_sth->execute('CAN'); > $insert_sth->execute('CANNOT'); >@@ -88,6 +91,20 @@ is( $borrowernumber, $borrowernumbers[0], "GetReservesFromItemnumber should retu > is( $branchcode, 'CPL', "GetReservesFromItemnumber should return a valid branchcode"); > ok($reserve_id, "Test GetReservesFromItemnumber()"); > >+my $hold = Koha::Holds->find( $reserve_id ); >+ok( $hold, "Koha::Holds found the hold" ); >+my $hold_biblio = $hold->biblio(); >+ok( $hold_biblio, "Got biblio using biblio() method" ); >+ok( $hold_biblio == $hold->biblio(), "biblio method returns stashed biblio" ); >+my $hold_item = $hold->item(); >+ok( $hold_item, "Got item using item() method" ); >+ok( $hold_item == $hold->item(), "item method returns stashed item" ); >+my $hold_branch = $hold->branch(); >+ok( $hold_branch, "Got branch using branch() method" ); >+ok( $hold_branch == $hold->branch(), "branch method returns stashed branch" ); >+my $hold_found = $hold->found(); >+$hold->set({ found => 'W'})->store(); >+is( Koha::Holds->waiting()->count(), 1, "Koha::Holds->waiting returns waiting holds" ); > > my ( $reserve ) = GetReservesFromBorrowernumber($borrowernumbers[0]); > ok( $reserve->{'borrowernumber'} eq $borrowernumbers[0], "Test GetReservesFromBorrowernumber()"); >-- >2.1.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 13851
:
36947
|
37303
|
38175
|
39740
|
40028
|
40039
|
40247
|
40256
|
40257
|
40258
|
40668
|
40669
|
40670