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

(-)a/t/db_dependent/Acquisition.t (-8 / +2 lines)
Lines 20-26 use Modern::Perl; Link Here
20
use POSIX qw(strftime);
20
use POSIX qw(strftime);
21
21
22
use Test::More tests => 87;
22
use Test::More tests => 87;
23
use Koha::Database;
23
use t::lib::Database;
24
24
25
BEGIN {
25
BEGIN {
26
    use_ok('C4::Acquisition');
26
    use_ok('C4::Acquisition');
Lines 118-128 sub _check_fields_of_orders { Link Here
118
}
118
}
119
119
120
120
121
my $schema = Koha::Database->new()->schema();
121
my $dbh = t::lib::Database::dbh;
122
$schema->storage->txn_begin();
123
124
my $dbh = C4::Context->dbh;
125
$dbh->{RaiseError} = 1;
126
122
127
# Creating some orders
123
# Creating some orders
128
my $booksellerid = C4::Bookseller::AddBookseller(
124
my $booksellerid = C4::Bookseller::AddBookseller(
Lines 920-924 ok((defined $order4->{datecancellationprinted}), "order is cancelled"); Link Here
920
ok(($order4->{cancellationreason} eq "foobar"), "order has cancellation reason \"foobar\"");
916
ok(($order4->{cancellationreason} eq "foobar"), "order has cancellation reason \"foobar\"");
921
ok((not defined GetBiblio($order4->{biblionumber})), "biblio does not exist anymore");
917
ok((not defined GetBiblio($order4->{biblionumber})), "biblio does not exist anymore");
922
# End of tests for DelOrder
918
# End of tests for DelOrder
923
924
$schema->storage->txn_rollback();
(-)a/t/lib/Database.pm (-1 / +19 lines)
Line 0 Link Here
0
- 
1
package t::lib::Database;
2
3
use C4::Context;
4
use Koha::Database;
5
6
sub dbh {
7
    my $dbh = C4::Context->dbh;
8
    my $schema = Koha::Database->new->schema;
9
    $schema->storage->txn_begin;
10
    $dbh->{RaiseError} = 1;
11
    return $dbh;
12
}
13
14
END {
15
    my $schema = Koha::Database->new->schema;
16
    $schema->storage->txn_rollback;
17
};
18
19
1;

Return to bug 14334