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

(-)a/t/db_dependent/Letters.t (-2 / +15 lines)
Lines 18-24 Link Here
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use Test::More tests => 83;
21
use Test::More tests => 85;
22
use Test::MockModule;
22
use Test::MockModule;
23
use Test::Warn;
23
use Test::Warn;
24
use Test::Exception;
24
use Test::Exception;
Lines 279-284 $prepared_letter = GetPreparedLetter(( Link Here
279
$my_content_letter = qq|This is a SMS for an $substitute->{status}|;
279
$my_content_letter = qq|This is a SMS for an $substitute->{status}|;
280
is( $prepared_letter->{content}, $my_content_letter, 'GetPreparedLetter returns the content correctly' );
280
is( $prepared_letter->{content}, $my_content_letter, 'GetPreparedLetter returns the content correctly' );
281
281
282
warning_is {
283
    $prepared_letter = GetPreparedLetter((
284
        module                 => 'my module',
285
        branchcode             => $library->{branchcode},
286
        letter_code            => 'my code',
287
        tables                 => $tables,
288
        substitute             => { status => undef },
289
        repeat                 => $repeat,
290
        message_transport_type => 'sms',
291
    ));
292
}
293
undef, "No warning if GetPreparedLetter called with substitute containing undefined value";
294
is( $prepared_letter->{content}, q|This is a SMS for an |, 'GetPreparedLetter returns the content correctly when substitute contains undefined value' );
295
282
$dbh->do(q{INSERT INTO letter (module, code, name, title, content) VALUES ('test_date','TEST_DATE','Test dates','A title with a timestamp: <<biblio.timestamp>>','This one only contains the date: <<biblio.timestamp | dateonly>>.');});
296
$dbh->do(q{INSERT INTO letter (module, code, name, title, content) VALUES ('test_date','TEST_DATE','Test dates','A title with a timestamp: <<biblio.timestamp>>','This one only contains the date: <<biblio.timestamp | dateonly>>.');});
283
$prepared_letter = GetPreparedLetter((
297
$prepared_letter = GetPreparedLetter((
284
    module                 => 'test_date',
298
    module                 => 'test_date',
285
- 

Return to bug 30781