|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 13; |
22 |
use Test::More tests => 14; |
| 23 |
use Test::Exception; |
23 |
use Test::Exception; |
| 24 |
use Test::Warn; |
24 |
use Test::Warn; |
| 25 |
|
25 |
|
|
Lines 1021-1023
subtest 'add_article_request_fee_if_needed() tests' => sub {
Link Here
|
| 1021 |
|
1021 |
|
| 1022 |
$schema->storage->txn_rollback; |
1022 |
$schema->storage->txn_rollback; |
| 1023 |
}; |
1023 |
}; |
| 1024 |
- |
1024 |
|
|
|
1025 |
subtest 'messages' => sub { |
| 1026 |
plan tests => 4; |
| 1027 |
|
| 1028 |
$schema->storage->txn_begin; |
| 1029 |
|
| 1030 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 1031 |
my $messages = $patron->messages; |
| 1032 |
is( $messages->count, 0, "No message yet" ); |
| 1033 |
my $message_1 = $builder->build_object( |
| 1034 |
{ |
| 1035 |
class => 'Koha::Patron::Messages', |
| 1036 |
value => { borrowernumber => $patron->borrowernumber } |
| 1037 |
} |
| 1038 |
); |
| 1039 |
my $message_2 = $builder->build_object( |
| 1040 |
{ |
| 1041 |
class => 'Koha::Patron::Messages', |
| 1042 |
value => { borrowernumber => $patron->borrowernumber } |
| 1043 |
} |
| 1044 |
); |
| 1045 |
|
| 1046 |
$messages = $patron->messages; |
| 1047 |
is( $messages->count, 2, "There are two messages for this patron" ); |
| 1048 |
is( $messages->next->message, $message_1->message ); |
| 1049 |
is( $messages->next->message, $message_2->message ); |
| 1050 |
|
| 1051 |
$schema->storage->txn_rollback; |
| 1052 |
}; |