Bugzilla – Attachment 19618 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]
[PASSED QA] Bug 10575 : GetOrdersByBiblionumber.t needs a database transaction
PASSED-QA-Bug-10575--GetOrdersByBiblionumbert-need.patch (text/plain), 2.07 KB, created by
Katrin Fischer
on 2013-07-14 07:17:41 UTC
(
hide
)
Description:
[PASSED QA] Bug 10575 : GetOrdersByBiblionumber.t needs a database transaction
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-07-14 07:17:41 UTC
Size:
2.07 KB
patch
obsolete
>From 2a546f82595607ee5e250b757d62182f4ffb3ff1 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] [PASSED QA] 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> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Tests pass. >--- > .../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.7.9.5
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