Lines 868-876
subtest 'set_or_blank' => sub {
Link Here
|
868 |
$schema->storage->txn_rollback; |
868 |
$schema->storage->txn_rollback; |
869 |
}; |
869 |
}; |
870 |
|
870 |
|
871 |
subtest 'messages() and add_message() tests' => sub { |
871 |
subtest 'messages(), add_message() and reset_messages() tests' => sub { |
872 |
|
872 |
|
873 |
plan tests => 6; |
873 |
plan tests => 8; |
874 |
|
874 |
|
875 |
my $patron = Koha::Patron->new; |
875 |
my $patron = Koha::Patron->new; |
876 |
|
876 |
|
Lines 887-890
subtest 'messages() and add_message() tests' => sub {
Link Here
|
887 |
is( ref($messages[1]), 'Koha::Object::Message', 'Right type returned' ); |
887 |
is( ref($messages[1]), 'Koha::Object::Message', 'Right type returned' ); |
888 |
is( $messages[0]->message, 'message_1', 'Right message recorded' ); |
888 |
is( $messages[0]->message, 'message_1', 'Right message recorded' ); |
889 |
is( $messages[1]->message, 'message_2', 'Right message recorded' ); |
889 |
is( $messages[1]->message, 'message_2', 'Right message recorded' ); |
|
|
890 |
|
891 |
$patron->reset_messages; |
892 |
@messages = @{ $patron->messages }; |
893 |
is( scalar @messages, 0, 'No messages are returned' ); |
894 |
|
895 |
$patron->reset_messages; |
896 |
@messages = @{ $patron->messages }; |
897 |
is( scalar @messages, 0, 'No messages are returned, things ok when calling on already empty list' ); |
890 |
}; |
898 |
}; |
891 |
- |
|
|