Bug 11587 - Add UT for IsSuperLibrarian if flags == 0
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 24 Jan 2014 12:00:37 +0000 (13:00 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 10 Mar 2014 15:56:22 +0000 (15:56 +0000)
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
t/Context.t

index 46e353e..6775b8e 100755 (executable)
@@ -2,7 +2,7 @@
 
 use Modern::Perl;
 use DBI;
-use Test::More tests => 12;
+use Test::More tests => 14;
 use Test::MockModule;
 
 BEGIN {
@@ -34,6 +34,11 @@ 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=undef, it is not a super librarian" );
+
+$userenv->{flags} = 0;
+$is_super_librarian = eval{ C4::Context::IsSuperLibrarian() };
+is ( $@, q||, "IsSuperLibrarian does not log an error if \$userenv->{flags} is equal to 0" );
 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');