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