@@ -, +, @@ --- t/db_dependent/Koha/Patron.t | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) --- a/t/db_dependent/Koha/Patron.t +++ a/t/db_dependent/Koha/Patron.t @@ -19,7 +19,7 @@ use Modern::Perl; -use Test::More tests => 2; +use Test::More tests => 3; use Test::Exception; use Koha::Database; @@ -154,3 +154,26 @@ subtest 'add_enrolment_fee_if_needed() tests' => sub { $schema->storage->txn_rollback; }; }; + +subtest 'is_superlibrarian() tests' => sub { + + plan tests => 2; + + $schema->storage->txn_begin; + + my $patron = $builder->build_object( + { + class => 'Koha::Patrons', + value => { + flags => 16 + } + } + ); + + ok( !$patron->is_superlibrarian, 'Patron is not a superlibrarian and the method returns the correct value' ); + + $patron->flags(1)->store->discard_changes; + ok( $patron->is_superlibrarian, 'Patron is a superlibrarian and the method returns the correct value' ); + + $schema->storage->txn_rollback; +}; --