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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
# 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();
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;
bless( $self, $class );
$self->schema( Koha::Database->new()->schema );
- eval {
- $self->schema->txn_begin();
- };
$self->schema->storage->sql_maker->quote_char('`');
+
return $self;
}
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