Bug 11549: Add regression test

test plan:
prove t/db_dependent/Acquisition/TransferOrder.t should fail before the
patch and success after applying it.

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing notes on last patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Jonathan Druart 2014-01-14 12:04:24 +01:00 committed by Galen Charlton
parent cbffe7bf24
commit e974b554a5
1 changed files with 9 additions and 2 deletions

View File

@ -2,13 +2,14 @@
use Modern::Perl;
use Test::More tests => 6;
use Test::More tests => 8;
use C4::Context;
use C4::Acquisition;
use C4::Biblio;
use C4::Items;
use C4::Bookseller;
use C4::Budgets;
use Koha::DateUtils;
use MARC::Record;
my $dbh = C4::Context->dbh;
@ -56,7 +57,7 @@ my $itemnumber = AddItem({}, $biblionumber);
my ( undef, $ordernumber ) = C4::Acquisition::NewOrder(
{
basketno => $basketno1,
quantity => 24,
quantity => 2,
biblionumber => $biblionumber,
budget_id => $budget->{budget_id},
}
@ -77,4 +78,10 @@ is(scalar GetOrders($basketno2), 1, "1 order in basket2");
($order) = GetOrders($basketno2);
is(scalar GetItemnumbersFromOrder($order->{ordernumber}), 1, "1 item in basket2's order");
ModReceiveOrder( $biblionumber, $newordernumber, 2, undef, undef, undef, undef, undef, undef, dt_from_string );
CancelReceipt( $newordernumber );
$order = GetOrder( $newordernumber );
is ( $order->{ordernumber}, $newordernumber, 'Regression test Bug 11549: After a transfer, receive and cancel the receive should be possible.' );
is ( $order->{basketno}, $basketno2, 'Regression test Bug 11549: The order still exist in the basket where the transfer has been done.');
$dbh->rollback;