Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 38; |
22 |
use Test::More tests => 39; |
23 |
use Test::Exception; |
23 |
use Test::Exception; |
24 |
use Test::Warn; |
24 |
use Test::Warn; |
25 |
use Time::Fake; |
25 |
use Time::Fake; |
Lines 2846-2848
subtest 'preferred_name' => sub {
Link Here
|
2846 |
is( $patron->preferred_name, "Preferred again", "Preferred name set on update when passed" ); |
2846 |
is( $patron->preferred_name, "Preferred again", "Preferred name set on update when passed" ); |
2847 |
|
2847 |
|
2848 |
}; |
2848 |
}; |
2849 |
- |
2849 |
|
|
|
2850 |
subtest 'ill_requests() tests' => sub { |
2851 |
|
2852 |
plan tests => 3; |
2853 |
|
2854 |
$schema->storage->txn_begin; |
2855 |
|
2856 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
2857 |
|
2858 |
my $reqs_rs = $patron->ill_requests(); |
2859 |
is( ref($reqs_rs), 'Koha::ILL::Requests', 'Returned object type is correct' ); |
2860 |
is( $reqs_rs->count, 0, 'No linked ILL requests for the patron' ); |
2861 |
|
2862 |
# add two requests |
2863 |
$builder->build_object( { class => 'Koha::ILL::Requests', value => { borrowernumber => $patron->id } } ); |
2864 |
$builder->build_object( { class => 'Koha::ILL::Requests', value => { borrowernumber => $patron->id } } ); |
2865 |
|
2866 |
$reqs_rs = $patron->ill_requests(); |
2867 |
is( $reqs_rs->count, 2, 'Two linked ILL requests for the patron' ); |
2868 |
|
2869 |
$schema->storage->txn_rollback; |
2870 |
}; |