Bugzilla – Attachment 39873 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/Letters.t AutoCommit fix
Bug-14334-tdbdependentLetterst-AutoCommit-fix.patch (text/plain), 1.45 KB, created by
Mark Tompsett
on 2015-06-04 20:14:25 UTC
(
hide
)
Description:
Bug 14334: t/db_dependent/Letters.t AutoCommit fix
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-06-04 20:14:25 UTC
Size:
1.45 KB
patch
obsolete
>From dde67284a0484f91c72835e0a4fd35c40af67369 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmcharlt@gmail.com> >Date: Thu, 4 Jun 2015 16:11:44 -0400 >Subject: [PATCH] Bug 14334: t/db_dependent/Letters.t AutoCommit fix > >TEST PLAN >---------- >1) git reset --hard origin/master >2) prove t/db_dependent/Letters.t > -- horrible failure about transaction >3) apply this patch >4) prove t/db_dependent/Letters.t > -- no issues >5) koha qa test tools. >--- > t/db_dependent/Letters.t | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t >index f53e75b..8599c3f 100644 >--- a/t/db_dependent/Letters.t >+++ b/t/db_dependent/Letters.t >@@ -45,11 +45,15 @@ use t::lib::Mocks; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Acquisition::Order; > use Koha::Acquisition::Bookseller; >+use Koha::Database; > > my $dbh = C4::Context->dbh; > >+my $database = Koha::Database->new(); >+my $schema = $database->schema(); >+$schema->storage->txn_begin(); >+ > # Start transaction >-$dbh->{AutoCommit} = 0; > $dbh->{RaiseError} = 1; > > $dbh->do(q|DELETE FROM letter|); >@@ -341,4 +345,4 @@ is($err, 1, "Successfully sent claim"); > is($mail{'To'}, 'testemail@mydomain.com', "mailto correct in sent claim"); > is($mail{'Message'}, 'my vendor|John Smith|Ordernumber ' . $ordernumber . ' (Silence in the library) (1 ordered)', 'Claim notice text constructed successfully'); > >-$dbh->rollback; >+$schema->storage->txn_rollback(); >-- >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