Bugzilla – Attachment 19617 Details for
Bug 10575
UT: GetOrdersByBiblionumber.t needs a database transaction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10575 : GetOrdersByBiblionumber.t needs a database transaction
Bug-10575--GetOrdersByBiblionumbert-needs-a-databa.patch (text/plain), 1.99 KB, created by
Chris Cormack
on 2013-07-14 07:09:10 UTC
(
hide
)
Description:
Bug 10575 : GetOrdersByBiblionumber.t needs a database transaction
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2013-07-14 07:09:10 UTC
Size:
1.99 KB
patch
obsolete
>From 3d99c0ac68c6e79796dcac26b9367e9d9b8425ba Mon Sep 17 00:00:00 2001 >From: Kenza Zaki <kenza.zaki@biblibre.com> >Date: Thu, 11 Jul 2013 16:28:11 +0200 >Subject: [PATCH] Bug 10575 : GetOrdersByBiblionumber.t needs a database > transaction > >Before this patch, the queries in GetOrdersByBiblionumber.t were commited in the database and have to be removed at the end. >This patch wraps tests in a database transaction. > >Test Plan : >prove t/db_dependent/Acquisition/GetOrdersByBiblionumber.t >t/db_dependent/Acquisition/GetOrdersByBiblionumber.t .. ok >All tests successful. >Files=1, Tests=3, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.37 cusr 0.05 csys = 0.45 CPU) >Result: PASS > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > t/db_dependent/Acquisition/GetOrdersByBiblionumber.t | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) > >diff --git a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t b/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t >index c801dd7..8bd0735 100644 >--- a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t >+++ b/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t >@@ -9,6 +9,11 @@ use C4::Bookseller; > use C4::Budgets; > use MARC::Record; > >+#Start transaction >+my $dbh = C4::Context->dbh; >+$dbh->{AutoCommit} = 0; >+$dbh->{RaiseError} = 1; >+ > my $booksellerid = C4::Bookseller::AddBookseller( > { > name => "my vendor", >@@ -70,15 +75,7 @@ is(scalar(@orders), 1, '1 order on biblionumber 1'); > @orders = GetOrdersByBiblionumber( $biblionumber2 ); > is(scalar(@orders), 2, '2 orders on biblionumber 2'); > >-END { >- C4::Acquisition::DelOrder( 1, $ordernumber1 ); >- C4::Acquisition::DelOrder( 2, $ordernumber2 ); >- C4::Acquisition::DelOrder( 3, $ordernumber3 ); >- C4::Budgets::DelBudget( $budgetid ); >- C4::Acquisition::DelBasket( $basketno ); >- C4::Bookseller::DelBookseller( $booksellerid ); >- C4::Biblio::DelBiblio($biblionumber1); >- C4::Biblio::DelBiblio($biblionumber2); >-}; >+#End transaction >+$dbh->rollback; > > done_testing; >-- >1.8.3.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 10575
:
19573
|
19617
|
19618