|
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 => 81; |
21 |
use Test::More tests => 82; |
| 22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
| 23 |
use Test::Warn; |
23 |
use Test::Warn; |
| 24 |
|
24 |
|
|
Lines 534-539
is($mail{'To'}, 'john.smith@test.de', "mailto correct in sent serial notificatio
Link Here
|
| 534 |
is($mail{'Message'}, 'Silence in the library,'.$subscriptionid.',No. 0', 'Serial notification text constructed successfully'); |
534 |
is($mail{'Message'}, 'Silence in the library,'.$subscriptionid.',No. 0', 'Serial notification text constructed successfully'); |
| 535 |
} |
535 |
} |
| 536 |
|
536 |
|
|
|
537 |
|
| 538 |
subtest 'TranslateNotices' => sub { |
| 539 |
plan tests => 3; |
| 540 |
$dbh->do( |
| 541 |
q| |
| 542 |
INSERT INTO letter (module, code, branchcode, name, title, content, message_transport_type, lang) VALUES |
| 543 |
('test', 'code', '', 'test', 'a test', 'just a test', 'email', 'default'), |
| 544 |
('test', 'code', '', 'test', 'una prueba', 'solo una prueba', 'email', 'es-ES'); |
| 545 |
| ); |
| 546 |
my $substitute = {}; |
| 547 |
my $letter = C4::Letters::GetPreparedLetter( |
| 548 |
module => 'test', |
| 549 |
letter_code => 'code', |
| 550 |
message_transport_type => 'email', |
| 551 |
substitute => $substitute, |
| 552 |
); |
| 553 |
is( |
| 554 |
$letter->{title}, |
| 555 |
'a test', |
| 556 |
'GetPreparedLetter should return the default one if the lang parameter is not provided' |
| 557 |
); |
| 558 |
|
| 559 |
$letter = C4::Letters::GetPreparedLetter( |
| 560 |
module => 'test', |
| 561 |
letter_code => 'code', |
| 562 |
message_transport_type => 'email', |
| 563 |
substitute => $substitute, |
| 564 |
lang => 'es-ES', |
| 565 |
); |
| 566 |
is( $letter->{title}, 'una prueba', |
| 567 |
'GetPreparedLetter should return the required notice if it exists' ); |
| 568 |
|
| 569 |
$letter = C4::Letters::GetPreparedLetter( |
| 570 |
module => 'test', |
| 571 |
letter_code => 'code', |
| 572 |
message_transport_type => 'email', |
| 573 |
substitute => $substitute, |
| 574 |
lang => 'fr-FR', |
| 575 |
); |
| 576 |
is( |
| 577 |
$letter->{title}, |
| 578 |
'a test', |
| 579 |
'GetPreparedLetter should return the default notice if the one required does not exist' |
| 580 |
); |
| 581 |
}; |
| 582 |
|
| 537 |
subtest 'SendQueuedMessages' => sub { |
583 |
subtest 'SendQueuedMessages' => sub { |
| 538 |
plan tests => 1; |
584 |
plan tests => 1; |
| 539 |
t::lib::Mocks::mock_preference( 'SMSSendDriver', 'Email' ); |
585 |
t::lib::Mocks::mock_preference( 'SMSSendDriver', 'Email' ); |
| 540 |
- |
|
|