@@ -, +, @@ --------- -- Tests 7 and 8 will fail -- All tests will succeed --- t/Context.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/t/Context.t +++ a/t/Context.t @@ -2,7 +2,7 @@ use Modern::Perl; use DBI; -use Test::More tests => 10; +use Test::More tests => 12; use Test::MockModule; BEGIN { @@ -31,6 +31,11 @@ $is_super_librarian = eval{ C4::Context::IsSuperLibrarian() }; is ( $@, q||, "IsSuperLibrarian does not log an error if userenv is defined" ); is ( $is_super_librarian, 1, "With flag=1, it is a super librarian" ); +$userenv->{flags} = undef; +$is_super_librarian = eval{ C4::Context::IsSuperLibrarian() }; +is ( $@, q||, "IsSuperLibrarian does not log an error if \$userenv->{flags} is undefined" ); +is ( $is_super_librarian, 0, "With flag=0, it is not a super librarian" ); + is(C4::Context::db_scheme2dbi('mysql'), 'mysql', 'ask for mysql, get mysql'); is(C4::Context::db_scheme2dbi('Pg'), 'Pg', 'ask for Pg, get Pg'); is(C4::Context::db_scheme2dbi('xxx'), 'mysql', 'ask for unsupported DBMS, get mysql'); --