Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 3; |
22 |
use Test::More tests => 4; |
23 |
use Test::Exception; |
23 |
use Test::Exception; |
24 |
|
24 |
|
25 |
use Koha::Database; |
25 |
use Koha::Database; |
Lines 192-194
subtest 'to_api() tests' => sub {
Link Here
|
192 |
|
192 |
|
193 |
$schema->storage->txn_rollback; |
193 |
$schema->storage->txn_rollback; |
194 |
}; |
194 |
}; |
195 |
- |
195 |
|
|
|
196 |
subtest 'is_superlibrarian() tests' => sub { |
197 |
|
198 |
plan tests => 2; |
199 |
|
200 |
$schema->storage->txn_begin; |
201 |
|
202 |
my $patron = $builder->build_object( |
203 |
{ |
204 |
class => 'Koha::Patrons', |
205 |
value => { |
206 |
flags => 16 |
207 |
} |
208 |
} |
209 |
); |
210 |
|
211 |
ok( !$patron->is_superlibrarian, 'Patron is not a superlibrarian and the method returns the correct value' ); |
212 |
|
213 |
$patron->flags(1)->store->discard_changes; |
214 |
ok( $patron->is_superlibrarian, 'Patron is a superlibrarian and the method returns the correct value' ); |
215 |
|
216 |
$schema->storage->txn_rollback; |
217 |
}; |