View | Details | Raw Unified | Return to bug 41818
Collapse All | Expand All

(-)a/t/db_dependent/Koha/Patron/Messages.t (-2 / +27 lines)
Lines 20-26 Link Here
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::NoWarnings;
22
use Test::NoWarnings;
23
use Test::More tests => 15;
23
use Test::More tests => 16;
24
24
25
use C4::Context;
25
use C4::Context;
26
use Koha::ActionLogs;
26
use Koha::ActionLogs;
Lines 140-145 is( Link Here
140
    "One message has been marked as read"
140
    "One message has been marked as read"
141
);
141
);
142
142
143
subtest 'message_without_newlines' => sub {
144
    plan tests => 6;
145
146
    my $message = Koha::Patron::Message->new( { message => "  Line 1\nLine 2\r\nLine 3 \n  " } );
147
148
    is(
149
        $message->message_without_newlines, 'Line 1 Line 2 Line 3',
150
        'Newlines and carriage returns removed, collapsed and trimmed'
151
    );
152
153
    $message->message("Multiple    spaces     stay collapsed");
154
    is( $message->message_without_newlines, 'Multiple spaces stay collapsed', 'Multiple spaces collapsed' );
155
156
    $message->message("\n\nOnly\nNewlines\n\n");
157
    is( $message->message_without_newlines, 'Only Newlines', 'Only newlines handled correctly' );
158
159
    $message->message("Already clean");
160
    is( $message->message_without_newlines, 'Already clean', 'Clean string returns as is' );
161
162
    $message->message(q{});
163
    is( $message->message_without_newlines, undef, 'Empty string returns undef' );
164
165
    $message->message(undef);
166
    is( $message->message_without_newlines, undef, 'Undef message returns undef' );
167
};
168
143
$schema->storage->txn_rollback;
169
$schema->storage->txn_rollback;
144
170
145
sub get_nb_of_logactions {
171
sub get_nb_of_logactions {
146
- 

Return to bug 41818