Bugzilla – Attachment 39874 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/Accounts.t AutoCommit fix
Bug-14334-tdbdependentAccountst-AutoCommit-fix.patch (text/plain), 1.63 KB, created by
Mark Tompsett
on 2015-06-04 20:28:09 UTC
(
hide
)
Description:
Bug 14334: t/db_dependent/Accounts.t AutoCommit fix
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-06-04 20:28:09 UTC
Size:
1.63 KB
patch
obsolete
>From 7e85848ef9b82a78534da4c0b1e0246e6156e15e Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Thu, 4 Jun 2015 16:25:09 -0400 >Subject: [PATCH] Bug 14334: t/db_dependent/Accounts.t AutoCommit fix > >There is no easy way to trigger an obvious problem, as this test >uses Koha::Borrowers and other DBIx things, which may or may not >be causing it to not blow up. > >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/Accounts.t | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index a167f02..bc45631 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -28,6 +28,7 @@ BEGIN { > use_ok('Koha::Borrower'); > use_ok('Data::Dumper'); > } >+use Koha::Database; > > can_ok( 'C4::Accounts', > qw( recordpayment >@@ -47,8 +48,10 @@ can_ok( 'C4::Accounts', > ); > > my $dbh = C4::Context->dbh; >+my $database = Koha::Database->new(); >+my $schema = $database->schema(); >+$schema->storage->txn_begin(); > $dbh->{RaiseError}=1; >-$dbh->{AutoCommit}=0; > $dbh->do(q|DELETE FROM accountlines|); > $dbh->do(q|DELETE FROM borrowers|); > $dbh->do(q|DELETE FROM issues|); >@@ -172,7 +175,7 @@ is($note,'$200.00 payment note', '$200.00 payment note is registered'); > > > >-$dbh->rollback; >+$schema->storage->txn_rollback(); > > > # Sub ------------------------------------------- >@@ -180,4 +183,4 @@ $dbh->rollback; > # C4::Context->userenv > sub Mock_userenv { > return $userenv; >-} >\ No newline at end of file >+} >-- >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