Lines 39-45
my $builder = t::lib::TestBuilder->new;
Link Here
|
39 |
|
39 |
|
40 |
subtest 'all() tests' => sub { |
40 |
subtest 'all() tests' => sub { |
41 |
|
41 |
|
42 |
plan tests => 16; |
42 |
plan tests => 14; |
43 |
|
43 |
|
44 |
$schema->storage->txn_begin; |
44 |
$schema->storage->txn_begin; |
45 |
|
45 |
|
Lines 68-79
subtest 'all() tests' => sub {
Link Here
|
68 |
$name = $plugin->GetName(undef); |
68 |
$name = $plugin->GetName(undef); |
69 |
is($name, '', 'received empty string as name of NULL/undefined library code'); |
69 |
is($name, '', 'received empty string as name of NULL/undefined library code'); |
70 |
|
70 |
|
71 |
$library = $plugin->GetLoggedInBranchcode(); |
|
|
72 |
is($library, '', 'no active library if there is no active user session'); |
73 |
|
74 |
t::lib::Mocks::mock_userenv({ branchcode => 'MYLIBRARY' }); |
71 |
t::lib::Mocks::mock_userenv({ branchcode => 'MYLIBRARY' }); |
75 |
$library = $plugin->GetLoggedInBranchcode(); |
|
|
76 |
is($library, 'MYLIBRARY', 'GetLoggedInBranchcode() returns active library'); |
77 |
|
72 |
|
78 |
t::lib::Mocks::mock_preference( 'IndependentBranches', 0 ); |
73 |
t::lib::Mocks::mock_preference( 'IndependentBranches', 0 ); |
79 |
my $libraries = $plugin->all(); |
74 |
my $libraries = $plugin->all(); |
80 |
- |
|
|