Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 10; |
22 |
use Test::More tests => 11; |
23 |
use Test::Exception; |
23 |
use Test::Exception; |
24 |
use Test::Warn; |
24 |
use Test::Warn; |
25 |
|
25 |
|
Lines 846-848
subtest 'article_requests() tests' => sub {
Link Here
|
846 |
|
846 |
|
847 |
$schema->storage->txn_rollback; |
847 |
$schema->storage->txn_rollback; |
848 |
}; |
848 |
}; |
849 |
- |
849 |
|
|
|
850 |
subtest 'messages' => sub { |
851 |
plan tests => 4; |
852 |
|
853 |
$schema->storage->txn_begin; |
854 |
|
855 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
856 |
my $messages = $patron->messages; |
857 |
is( $messages->count, 0, "No message yet" ); |
858 |
my $message_1 = $builder->build_object( |
859 |
{ |
860 |
class => 'Koha::Patron::Messages', |
861 |
value => { borrowernumber => $patron->borrowernumber } |
862 |
} |
863 |
); |
864 |
my $message_2 = $builder->build_object( |
865 |
{ |
866 |
class => 'Koha::Patron::Messages', |
867 |
value => { borrowernumber => $patron->borrowernumber } |
868 |
} |
869 |
); |
870 |
|
871 |
$messages = $patron->messages; |
872 |
is( $messages->count, 2, "There are two messages for this patron" ); |
873 |
is( $messages->next->message, $message_1->message ); |
874 |
is( $messages->next->message, $message_2->message ); |
875 |
|
876 |
$schema->storage->txn_rollback; |
877 |
}; |