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

(-)a/t/Context.t (-2 / +6 lines)
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 => 12;
5
use Test::More tests => 14;
6
use Test::MockModule;
6
use Test::MockModule;
7
7
8
BEGIN {
8
BEGIN {
Lines 34-39 is ( $is_super_librarian, 1, "With flag=1, it is a super librarian" ); Link Here
34
$userenv->{flags} = undef;
34
$userenv->{flags} = undef;
35
$is_super_librarian = eval{ C4::Context::IsSuperLibrarian() };
35
$is_super_librarian = eval{ C4::Context::IsSuperLibrarian() };
36
is ( $@, q||, "IsSuperLibrarian does not log an error if \$userenv->{flags} is undefined" );
36
is ( $@, q||, "IsSuperLibrarian does not log an error if \$userenv->{flags} is undefined" );
37
is ( $is_super_librarian, 0, "With flag=undef, it is not a super librarian" );
38
39
$userenv->{flags} = 0;
40
$is_super_librarian = eval{ C4::Context::IsSuperLibrarian() };
41
is ( $@, q||, "IsSuperLibrarian does not log an error if \$userenv->{flags} is equal to 0" );
37
is ( $is_super_librarian, 0, "With flag=0, it is not a super librarian" );
42
is ( $is_super_librarian, 0, "With flag=0, it is not a super librarian" );
38
43
39
is(C4::Context::db_scheme2dbi('mysql'), 'mysql', 'ask for mysql, get mysql');
44
is(C4::Context::db_scheme2dbi('mysql'), 'mysql', 'ask for mysql, get mysql');
40
- 

Return to bug 11587