Lines 21-26
use Modern::Perl;
Link Here
|
21 |
|
21 |
|
22 |
use Test::More tests => 12; |
22 |
use Test::More tests => 12; |
23 |
use Test::Mojo; |
23 |
use Test::Mojo; |
|
|
24 |
use t::lib::Mocks; |
24 |
use t::lib::TestBuilder; |
25 |
use t::lib::TestBuilder; |
25 |
|
26 |
|
26 |
use C4::Auth; |
27 |
use C4::Auth; |
Lines 32-42
use Koha::Database;
Link Here
|
32 |
use Koha::Patron; |
33 |
use Koha::Patron; |
33 |
use Koha::Items; |
34 |
use Koha::Items; |
34 |
|
35 |
|
|
|
36 |
my $schema = Koha::Database->new->schema; |
35 |
my $builder = t::lib::TestBuilder->new(); |
37 |
my $builder = t::lib::TestBuilder->new(); |
36 |
|
38 |
|
37 |
my $dbh = C4::Context->dbh; |
39 |
# FIXME: sessionStorage defaults to mysql, but it seems to break transaction handling |
38 |
$dbh->{AutoCommit} = 0; |
40 |
# this affects the other REST api tests |
39 |
$dbh->{RaiseError} = 1; |
41 |
t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); |
|
|
42 |
|
43 |
$schema->storage->txn_begin; |
40 |
|
44 |
|
41 |
$ENV{REMOTE_ADDR} = '127.0.0.1'; |
45 |
$ENV{REMOTE_ADDR} = '127.0.0.1'; |
42 |
my $t = Test::Mojo->new('Koha::REST::V1'); |
46 |
my $t = Test::Mojo->new('Koha::REST::V1'); |
Lines 99-105
$t->request_ok($tx)
Link Here
|
99 |
->json_is('/biblionumber' => $biblionumber) |
103 |
->json_is('/biblionumber' => $biblionumber) |
100 |
->json_is('/itemnotes_nonpublic' => $item->{itemnotes_nonpublic}); |
104 |
->json_is('/itemnotes_nonpublic' => $item->{itemnotes_nonpublic}); |
101 |
|
105 |
|
102 |
$dbh->rollback; |
106 |
$schema->storage->txn_rollback; |
103 |
|
107 |
|
104 |
sub create_session { |
108 |
sub create_session { |
105 |
my (@borrowers) = @_; |
109 |
my (@borrowers) = @_; |
106 |
- |
|
|