Browse Source

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>
17.05.x
Marcel de Rooy 6 years ago
committed by Kyle M Hall
parent
commit
07de44bcd1
  1. 7
      t/db_dependent/Holds/CancelReserves.t
  2. 4
      t/db_dependent/Holds/WaitingReserves.t

7
t/db_dependent/Holds/CancelReserves.t

@ -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;

4
t/db_dependent/Holds/WaitingReserves.t

@ -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;

Loading…
Cancel
Save