Lines 41-51
t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' );
Link Here
|
41 |
my $remote_address = '127.0.0.1'; |
41 |
my $remote_address = '127.0.0.1'; |
42 |
my $t = Test::Mojo->new('Koha::REST::V1'); |
42 |
my $t = Test::Mojo->new('Koha::REST::V1'); |
43 |
|
43 |
|
44 |
# Mock userenv branchcode |
|
|
45 |
my $branchcode = $builder->build({ source => 'Branch' })->{ branchcode }; |
46 |
my $module = new Test::MockModule('C4::Context'); |
47 |
$module->mock('userenv', sub { { branch => $branchcode } }); |
48 |
|
49 |
subtest 'get() tests' => sub { |
44 |
subtest 'get() tests' => sub { |
50 |
plan tests => 34; |
45 |
plan tests => 34; |
51 |
|
46 |
|
Lines 55-60
subtest 'get() tests' => sub {
Link Here
|
55 |
my ($borrowernumber, $sessionid) = create_user_and_session(); |
50 |
my ($borrowernumber, $sessionid) = create_user_and_session(); |
56 |
my ($librariannnumber, $librariansessionid) = create_user_and_session(2); |
51 |
my ($librariannnumber, $librariansessionid) = create_user_and_session(2); |
57 |
|
52 |
|
|
|
53 |
# Mock userenv branchcode |
54 |
my $branchcode = $builder->build({ source => 'Branch' })->{ branchcode }; |
55 |
my $module = new Test::MockModule('C4::Context'); |
56 |
$module->mock('userenv', sub { { branch => $branchcode } }); |
57 |
|
58 |
# 1. Patrons |
58 |
# 1. Patrons |
59 |
my $patron = Koha::Patrons->find($borrowernumber); |
59 |
my $patron = Koha::Patrons->find($borrowernumber); |
60 |
my $librarian = Koha::Patrons->find($librariannnumber); |
60 |
my $librarian = Koha::Patrons->find($librariannnumber); |
61 |
- |
|
|