Bug 12063: [QA Follow-up] Small change of two test scripts

Removing dbh from one script, changing rollback in the other.
Schema is leading now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Marcel de Rooy 2017-05-04 14:15:51 +02:00 committed by Kyle M Hall
parent 2144fecdf0
commit 07de44bcd1
2 changed files with 3 additions and 8 deletions

View File

@ -14,11 +14,6 @@ use_ok('C4::Reserves');
my $schema = Koha::Database->new->schema;
$schema->storage->txn_begin;
my $dbh = C4::Context->dbh;
$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
my $builder = t::lib::TestBuilder->new();
t::lib::Mocks::mock_preference('ExpireReservesOnHolidays', 0);
@ -99,3 +94,5 @@ t::lib::Mocks::mock_preference('ExpireReservesOnHolidays', 1);
CancelExpiredReserves();
$r3 = Koha::Holds->find($reserve3->{reserve_id});
is($r3, undef,'Reserve 3 should be canceled.');
$schema->storage->txn_rollback;

View File

@ -16,8 +16,6 @@ my $schema = Koha::Database->new->schema;
$schema->storage->txn_begin;
my $dbh = C4::Context->dbh;
$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
$dbh->do(q{DELETE FROM special_holidays});
$dbh->do(q{DELETE FROM repeatable_holidays});
$dbh->do("DELETE FROM reserves");
@ -243,4 +241,4 @@ ModReserveAffect( $item4->{itemnumber}, $patron2->{borrowernumber}, 0, $reserve4
my $r4 = Koha::Holds->find($reserve4->{reserve_id});
is($r4->expirationdate, $requested_expiredate->ymd, 'Requested expiration date should be kept' );
$dbh->rollback;
$schema->storage->txn_rollback;