Lines 2-8
Link Here
|
2 |
|
2 |
|
3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
4 |
use DBI; |
4 |
use DBI; |
5 |
use Test::More tests => 10; |
5 |
use Test::More tests => 12; |
6 |
use Test::MockModule; |
6 |
use Test::MockModule; |
7 |
|
7 |
|
8 |
BEGIN { |
8 |
BEGIN { |
Lines 31-36
$is_super_librarian = eval{ C4::Context::IsSuperLibrarian() };
Link Here
|
31 |
is ( $@, q||, "IsSuperLibrarian does not log an error if userenv is defined" ); |
31 |
is ( $@, q||, "IsSuperLibrarian does not log an error if userenv is defined" ); |
32 |
is ( $is_super_librarian, 1, "With flag=1, it is a super librarian" ); |
32 |
is ( $is_super_librarian, 1, "With flag=1, it is a super librarian" ); |
33 |
|
33 |
|
|
|
34 |
$userenv->{flags} = undef; |
35 |
$is_super_librarian = eval{ C4::Context::IsSuperLibrarian() }; |
36 |
is ( $@, q||, "IsSuperLibrarian does not log an error if \$userenv->{flags} is undefined" ); |
37 |
is ( $is_super_librarian, 0, "With flag=0, it is not a super librarian" ); |
38 |
|
34 |
is(C4::Context::db_scheme2dbi('mysql'), 'mysql', 'ask for mysql, get mysql'); |
39 |
is(C4::Context::db_scheme2dbi('mysql'), 'mysql', 'ask for mysql, get mysql'); |
35 |
is(C4::Context::db_scheme2dbi('Pg'), 'Pg', 'ask for Pg, get Pg'); |
40 |
is(C4::Context::db_scheme2dbi('Pg'), 'Pg', 'ask for Pg, get Pg'); |
36 |
is(C4::Context::db_scheme2dbi('xxx'), 'mysql', 'ask for unsupported DBMS, get mysql'); |
41 |
is(C4::Context::db_scheme2dbi('xxx'), 'mysql', 'ask for unsupported DBMS, get mysql'); |
37 |
- |
|
|