Bugzilla – Attachment 40086 Details for
Bug 14334
DBI fighting DBIx over Autocommit in tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14334: t/db_dependent/Circulation.t AutoCommit fix
Bug-14334-tdbdependentCirculationt-AutoCommit-fix.patch (text/plain), 2.44 KB, created by
Mark Tompsett
on 2015-06-10 23:08:03 UTC
(
hide
)
Description:
Bug 14334: t/db_dependent/Circulation.t AutoCommit fix
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-06-10 23:08:03 UTC
Size:
2.44 KB
patch
obsolete
>From 809a1dcfdd65d4a8137981e70b985f1b0965760d Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Wed, 10 Jun 2015 17:03:25 +0000 >Subject: [PATCH] Bug 14334: t/db_dependent/Circulation.t AutoCommit fix > >There is no easy way to trigger an obvious problem. >Confirmed with khall that tweaking those two other lines to >ensure the autocommit fix will be correct. >(http://irc.koha-community.org/koha/2015-06-10#i_1686796) > >TEST PLAN >--------- >1) apply patch >2) git diff origin/master > -- Are the additions/subtractions similar to > http://paste.lisp.org/display/149194? >3) run koha qa test tools >--- > t/db_dependent/Circulation.t | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 30a5fe7..8b2b37a 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -34,10 +34,12 @@ BEGIN { > } > > my $dbh = C4::Context->dbh; >-my $schema = Koha::Database->new()->schema(); >+my $database = Koha::Database->new(); >+my $schema = $database->schema(); >+ > > # Start transaction >-$dbh->{AutoCommit} = 0; >+$schema->storage->txn_begin(); > $dbh->{RaiseError} = 1; > > # Start with a clean slate >@@ -302,7 +304,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); > is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds'); > > # Now let's add an item level hold, we should no longer be able to renew the item >- my $hold = Koha::Database->new()->schema()->resultset('Reserve')->create( >+ my $hold = $schema->resultset('Reserve')->create( > { > borrowernumber => $hold_waiting_borrowernumber, > biblionumber => $biblionumber, >@@ -317,7 +319,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); > > # Now let's add a waiting hold on the 3rd item, it's no longer available tp check out by just anyone, so we should no longer > # be able to renew these items >- $hold = Koha::Database->new()->schema()->resultset('Reserve')->create( >+ $hold = $schema->resultset('Reserve')->create( > { > borrowernumber => $hold_waiting_borrowernumber, > biblionumber => $biblionumber, >@@ -594,6 +596,6 @@ C4::Context->dbh->do("DELETE FROM accountlines"); > is ( $count, 0, "Calling UpdateFine on non-existant fine with an amount of 0 does not result in an empty fine" ); > } > >-$dbh->rollback; >+$schema->storage->txn_rollback(); > > 1; >-- >2.1.4
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 14334
:
39871
|
39872
|
39873
|
39874
|
39875
|
39876
|
39877
|
39879
|
39880
|
39881
|
39882
|
39883
|
39884
|
39885
|
40080
|
40086
|
40184
|
82989
|
83129
|
83201