Bugzilla – Attachment 26144 Details for
Bug 11550
Add a couple of unit tests for C4::Acq::GetOrder
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 11550: Add UT for C4::Acquisition::GetOrder
PASSED-QA-Bug-11550-Add-UT-for-C4AcquisitionGetOrd.patch (text/plain), 1.77 KB, created by
Katrin Fischer
on 2014-03-12 09:25:20 UTC
(
hide
)
Description:
[PASSED QA] Bug 11550: Add UT for C4::Acquisition::GetOrder
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-03-12 09:25:20 UTC
Size:
1.77 KB
patch
obsolete
>From 839e3f61678672060b39ee52e24efa7e500d903e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 14 Jan 2014 12:21:43 +0100 >Subject: [PATCH] [PASSED QA] Bug 11550: Add UT for C4::Acquisition::GetOrder > >If GetOrder is called with a nonexistent ordernumber or without any >ordernumber, it should return undef. > >Test plan: >prove t/db_dependent/Acquisition.t > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Updated number of tests to 68, tests and QA script all happy now. >Looked at a few pages in aquisition using GetOrder as well. >--- > C4/Acquisition.pm | 2 ++ > t/db_dependent/Acquisition.t | 5 +++++ > 2 files changed, 7 insertions(+) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 6446a07..33aa8e3 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -1102,6 +1102,8 @@ C<$order> are fields from the biblio, biblioitems, aqorders tables of the Koha d > > sub GetOrder { > my ($ordernumber) = @_; >+ return unless $ordernumber; >+ > my $dbh = C4::Context->dbh; > my $query = qq{SELECT > aqorders.*, >diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t >index 185b7ac..3a5cd4f 100755 >--- a/t/db_dependent/Acquisition.t >+++ b/t/db_dependent/Acquisition.t >@@ -840,4 +840,9 @@ is( $order3->{'quantityreceived'}, 2, 'Order not split up' ); > is( $order3->{'quantity'}, 2, '2 items on order' ); > is( $order3->{'budget_id'}, $budgetid2, 'Budget has changed' ); > >+my $nonexistent_order = GetOrder(); >+is( $nonexistent_order, undef, 'GetOrder returns undef if no ordernumber is given' ); >+$nonexistent_order = GetOrder( 424242424242 ); >+is( $nonexistent_order, undef, 'GetOrder returns undef if a nonexistent ordernumber is given' ); >+ > $dbh->rollback; >-- >1.8.3.2
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 11550
:
24277
|
25686
|
25955
|
26124
|
26144
|
26145
|
26146