|
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 => 79; |
21 |
use Test::More tests => 80; |
| 22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
| 23 |
use Test::Warn; |
23 |
use Test::Warn; |
| 24 |
|
24 |
|
|
Lines 489-491
is($err2, 1, "Successfully sent serial notification");
Link Here
|
| 489 |
is($mail{'To'}, 'john.smith@test.de', "mailto correct in sent serial notification"); |
489 |
is($mail{'To'}, 'john.smith@test.de', "mailto correct in sent serial notification"); |
| 490 |
is($mail{'Message'}, 'Silence in the library,'.$subscriptionid.',No. 0', 'Serial notification text constructed successfully'); |
490 |
is($mail{'Message'}, 'Silence in the library,'.$subscriptionid.',No. 0', 'Serial notification text constructed successfully'); |
| 491 |
} |
491 |
} |
| 492 |
- |
492 |
|
|
|
493 |
subtest 'TranslateNotices' => sub { |
| 494 |
plan tests => 3; |
| 495 |
$dbh->do( |
| 496 |
q| |
| 497 |
INSERT INTO letter (module, code, branchcode, name, title, content, message_transport_type, lang) VALUES |
| 498 |
('test', 'code', '', 'test', 'a test', 'just a test', 'email', 'default'), |
| 499 |
('test', 'code', '', 'test', 'una prueba', 'solo una prueba', 'email', 'es-ES'); |
| 500 |
| ); |
| 501 |
my $substitute = {}; |
| 502 |
my $letter = C4::Letters::GetPreparedLetter( |
| 503 |
module => 'test', |
| 504 |
letter_code => 'code', |
| 505 |
message_transport_type => 'email', |
| 506 |
substitute => $substitute, |
| 507 |
); |
| 508 |
is( |
| 509 |
$letter->{title}, |
| 510 |
'a test', |
| 511 |
'GetPreparedLetter should return the default one if the lang parameter is not provided' |
| 512 |
); |
| 513 |
|
| 514 |
$letter = C4::Letters::GetPreparedLetter( |
| 515 |
module => 'test', |
| 516 |
letter_code => 'code', |
| 517 |
message_transport_type => 'email', |
| 518 |
substitute => $substitute, |
| 519 |
lang => 'es-ES', |
| 520 |
); |
| 521 |
is( $letter->{title}, 'una prueba', |
| 522 |
'GetPreparedLetter should return the required notice if it exists' ); |
| 523 |
|
| 524 |
$letter = C4::Letters::GetPreparedLetter( |
| 525 |
module => 'test', |
| 526 |
letter_code => 'code', |
| 527 |
message_transport_type => 'email', |
| 528 |
substitute => $substitute, |
| 529 |
lang => 'fr-FR', |
| 530 |
); |
| 531 |
is( |
| 532 |
$letter->{title}, |
| 533 |
'a test', |
| 534 |
'GetPreparedLetter should return the default notice if the one required does not exist' |
| 535 |
); |
| 536 |
}; |