Bugzilla – Attachment 32898 Details for
Bug 7162
Factorize code for order cancellation and add field for giving a reason
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 7162: Add unit tests for DelOrder
Bug-7162-Add-unit-tests-for-DelOrder.patch (text/plain), 2.36 KB, created by
Julian Maurice
on 2014-10-29 12:57:58 UTC
(
hide
)
Description:
[PASSED QA] Bug 7162: Add unit tests for DelOrder
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2014-10-29 12:57:58 UTC
Size:
2.36 KB
patch
obsolete
>From 090b4e2165867619338ccd0c11e928a7dcd783bf Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 13 Jun 2014 12:55:44 +0200 >Subject: [PATCH] Bug 7162: Add unit tests for DelOrder > >--- > t/db_dependent/Acquisition.t | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t >index 96a0b5e..05e1f99 100755 >--- a/t/db_dependent/Acquisition.t >+++ b/t/db_dependent/Acquisition.t >@@ -8,7 +8,7 @@ use POSIX qw(strftime); > > use C4::Bookseller qw( GetBookSellerFromId ); > >-use Test::More tests => 75; >+use Test::More tests => 87; > > BEGIN { > use_ok('C4::Acquisition'); >@@ -884,4 +884,30 @@ is( $nonexistent_order, undef, 'GetOrder returns undef if no ordernumber is give > $nonexistent_order = GetOrder( 424242424242 ); > is( $nonexistent_order, undef, 'GetOrder returns undef if a nonexistent ordernumber is given' ); > >+# Tests for DelOrder >+my $order1 = GetOrder($ordernumbers[0]); >+my $error = DelOrder($order1->{biblionumber}, $order1->{ordernumber}); >+ok((not defined $error), "DelOrder does not fail"); >+$order1 = GetOrder($order1->{ordernumber}); >+ok((defined $order1->{datecancellationprinted}), "order is cancelled"); >+ok((not defined $order1->{cancellationreason}), "order has no cancellation reason"); >+ok((defined GetBiblio($order1->{biblionumber})), "biblio still exists"); >+ >+my $order2 = GetOrder($ordernumbers[1]); >+my $error = DelOrder($order2->{biblionumber}, $order2->{ordernumber}, 1); >+ok((not defined $error), "DelOrder does not fail"); >+$order2 = GetOrder($order2->{ordernumber}); >+ok((defined $order2->{datecancellationprinted}), "order is cancelled"); >+ok((not defined $order2->{cancellationreason}), "order has no cancellation reason"); >+ok((not defined GetBiblio($order2->{biblionumber})), "biblio does not exist anymore"); >+ >+my $order4 = GetOrder($ordernumbers[3]); >+my $error = DelOrder($order4->{biblionumber}, $order4->{ordernumber}, 1, "foobar"); >+ok((not defined $error), "DelOrder does not fail"); >+$order4 = GetOrder($order4->{ordernumber}); >+ok((defined $order4->{datecancellationprinted}), "order is cancelled"); >+ok(($order4->{cancellationreason} eq "foobar"), "order has cancellation reason \"foobar\""); >+ok((not defined GetBiblio($order4->{biblionumber})), "biblio does not exist anymore"); >+# End of tests for DelOrder >+ > $dbh->rollback; >-- >1.9.1
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 7162
:
6219
|
7007
|
9148
|
9238
|
13224
|
13225
|
16373
|
16374
|
16409
|
16457
|
18455
|
18456
|
19315
|
21333
|
21334
|
21335
|
22719
|
22720
|
22721
|
24075
|
24076
|
24077
|
26235
|
26236
|
26237
|
28353
|
28558
|
28559
|
28560
|
28836
|
29535
|
29536
|
29661
|
29662
|
29663
|
29664
|
29665
|
29698
|
29889
|
29890
|
29891
|
29892
|
29893
|
29894
|
29918
|
29943
|
32895
|
32896
|
32897
| 32898 |
32899
|
32900
|
32902