Lines 448-455
subtest "to_api() tests" => sub {
Link Here
|
448 |
|
448 |
|
449 |
t::lib::Mocks::mock_userenv( { patron => $patron } ); |
449 |
t::lib::Mocks::mock_userenv( { patron => $patron } ); |
450 |
|
450 |
|
451 |
is( ref($patron_1->to_api), 'HASH', 'Returns the object hash' ); |
451 |
is( ref($patron_1->to_api({ user => $patron })), 'HASH', 'Returns the object hash' ); |
452 |
is( $patron_2->to_api, undef, 'Not accessible, returns undef' ); |
452 |
is( $patron_2->to_api({ user => $patron }), undef, 'Not accessible, returns undef' ); |
453 |
|
453 |
|
454 |
$schema->storage->txn_rollback; |
454 |
$schema->storage->txn_rollback; |
455 |
}; |
455 |
}; |
Lines 1031-1037
subtest 'messages() and add_message() tests' => sub {
Link Here
|
1031 |
$schema->storage->txn_rollback; |
1031 |
$schema->storage->txn_rollback; |
1032 |
}; |
1032 |
}; |
1033 |
|
1033 |
|
1034 |
subtest 'accessible() tests' => sub { |
1034 |
subtest 'is_accessible() tests' => sub { |
1035 |
|
1035 |
|
1036 |
plan tests => 2; |
1036 |
plan tests => 2; |
1037 |
|
1037 |
|
Lines 1059-1066
subtest 'accessible() tests' => sub {
Link Here
|
1059 |
|
1059 |
|
1060 |
t::lib::Mocks::mock_userenv( { patron => $patron } ); |
1060 |
t::lib::Mocks::mock_userenv( { patron => $patron } ); |
1061 |
|
1061 |
|
1062 |
ok( $patron_1->accessible, 'Has access to the patron' ); |
1062 |
ok( $patron_1->is_accessible({ user => $patron }), 'Has access to the patron' ); |
1063 |
ok( !$patron_2->accessible, 'Does not have access to the patron' ); |
1063 |
ok( !$patron_2->is_accessible({ user => $patron }), 'Does not have access to the patron' ); |
1064 |
|
1064 |
|
1065 |
$schema->storage->txn_rollback; |
1065 |
$schema->storage->txn_rollback; |
1066 |
}; |
1066 |
}; |
1067 |
- |
|
|