Bugzilla – Attachment 44284 Details for
Bug 15081
TestBuilder should not handle the transaction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15081: Take transaction handling out from TestBuilder
Bug-15081-Take-transaction-handling-out-from-TestB.patch (text/plain), 2.13 KB, created by
Marc Véron
on 2015-11-02 07:11:07 UTC
(
hide
)
Description:
Bug 15081: Take transaction handling out from TestBuilder
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-11-02 07:11:07 UTC
Size:
2.13 KB
patch
obsolete
>From 33ad4df9148b7815e2416457c8fcec047a1d48fa Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Sat, 31 Oct 2015 12:29:09 -0300 >Subject: [PATCH] Bug 15081: Take transaction handling out from TestBuilder >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch removes transaction handling code from TestBuilder. >It fixes the TestBuilder.t to handle the transaction on its own. > >Verify that t/db_dependent/TestBuilder.t passes. > >Followed test plan, TestBuilder.t passes >Signed-off-by: Marc Véron <veron@veron.ch> >--- > t/db_dependent/TestBuilder.t | 9 +++++++++ > t/lib/TestBuilder.pm | 13 +------------ > 2 files changed, 10 insertions(+), 12 deletions(-) > >diff --git a/t/db_dependent/TestBuilder.t b/t/db_dependent/TestBuilder.t >index 70aa7cd..0602912 100644 >--- a/t/db_dependent/TestBuilder.t >+++ b/t/db_dependent/TestBuilder.t >@@ -18,12 +18,17 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+ > use Test::More tests => 41; > >+use Koha::Database; >+ > BEGIN { > use_ok('t::lib::TestBuilder'); > } > >+my $schema = Koha::Database->new->schema; >+$schema->storage->txn_begin; > > my $builder = t::lib::TestBuilder->new(); > >@@ -251,3 +256,7 @@ $bookseller = $builder->build({ > delete $bookseller->{_fk}; > $bookseller_from_db = $rs_aqbookseller->find($bookseller); > is( $bookseller_from_db->in_storage, 1, 'build with only_fk = 0 stores the entry correctly' ); >+ >+$schema->storage->txn_rollback; >+ >+1; >diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm >index 7d6d971..254af61 100644 >--- a/t/lib/TestBuilder.pm >+++ b/t/lib/TestBuilder.pm >@@ -72,10 +72,8 @@ sub new { > bless( $self, $class ); > > $self->schema( Koha::Database->new()->schema ); >- eval { >- $self->schema->txn_begin(); >- }; > $self->schema->storage->sql_maker->quote_char('`'); >+ > return $self; > } > >@@ -356,15 +354,6 @@ sub _gen_blob { > return 'b'; > } > >- >-sub DESTROY { >- my $self = shift; >- eval { >- $self->schema->txn_rollback(); >- }; >-} >- >- > =head1 NAME > > t::lib::TestBuilder.pm - Koha module to simplify the writing of tests >-- >1.7.10.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 15081
:
44281
|
44282
|
44284
|
44286
|
44387
|
44388
|
44389