View | Details | Raw Unified | Return to bug 14334
Collapse All | Expand All

(-)a/t/db_dependent/Circulation.t (-6 / +7 lines)
Lines 34-43 BEGIN { Link Here
34
}
34
}
35
35
36
my $dbh = C4::Context->dbh;
36
my $dbh = C4::Context->dbh;
37
my $schema = Koha::Database->new()->schema();
37
my $database = Koha::Database->new();
38
my $schema = $database->schema();
39
38
40
39
# Start transaction
41
# Start transaction
40
$dbh->{AutoCommit} = 0;
42
$schema->storage->txn_begin();
41
$dbh->{RaiseError} = 1;
43
$dbh->{RaiseError} = 1;
42
44
43
# Start with a clean slate
45
# Start with a clean slate
Lines 302-308 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
302
    is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds');
304
    is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds');
303
305
304
    # Now let's add an item level hold, we should no longer be able to renew the item
306
    # Now let's add an item level hold, we should no longer be able to renew the item
305
    my $hold = Koha::Database->new()->schema()->resultset('Reserve')->create(
307
    my $hold = $schema->resultset('Reserve')->create(
306
        {
308
        {
307
            borrowernumber => $hold_waiting_borrowernumber,
309
            borrowernumber => $hold_waiting_borrowernumber,
308
            biblionumber   => $biblionumber,
310
            biblionumber   => $biblionumber,
Lines 317-323 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
317
319
318
    # Now let's add a waiting hold on the 3rd item, it's no longer available tp check out by just anyone, so we should no longer
320
    # Now let's add a waiting hold on the 3rd item, it's no longer available tp check out by just anyone, so we should no longer
319
    # be able to renew these items
321
    # be able to renew these items
320
    $hold = Koha::Database->new()->schema()->resultset('Reserve')->create(
322
    $hold = $schema->resultset('Reserve')->create(
321
        {
323
        {
322
            borrowernumber => $hold_waiting_borrowernumber,
324
            borrowernumber => $hold_waiting_borrowernumber,
323
            biblionumber   => $biblionumber,
325
            biblionumber   => $biblionumber,
Lines 594-599 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
594
    is ( $count, 0, "Calling UpdateFine on non-existant fine with an amount of 0 does not result in an empty fine" );
596
    is ( $count, 0, "Calling UpdateFine on non-existant fine with an amount of 0 does not result in an empty fine" );
595
}
597
}
596
598
597
$dbh->rollback;
599
$schema->storage->txn_rollback();
598
600
599
1;
601
1;
600
- 

Return to bug 14334