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.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0b35290011)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Conflicts:
t/db_dependent/Acquisition.t
This commit is contained in:
parent
78decc11a1
commit
a326d2d265
|
|
@ -1101,6 +1101,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.*,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use POSIX qw(strftime);
|
|||
|
||||
use C4::Bookseller qw( GetBookSellerFromId );
|
||||
|
||||
use Test::More tests => 64;
|
||||
use Test::More tests => 66;
|
||||
|
||||
BEGIN {
|
||||
use_ok('C4::Acquisition');
|
||||
|
|
@ -225,4 +225,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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue