|
Lines 452-458
subtest '->get_effective_marcorgcode' => sub {
Link Here
|
| 452 |
$schema->storage->txn_rollback; |
452 |
$schema->storage->txn_rollback; |
| 453 |
}; |
453 |
}; |
| 454 |
|
454 |
|
| 455 |
subtest '->get_effective_email' => sub { |
455 |
subtest '->inbound_email_address' => sub { |
| 456 |
|
456 |
|
| 457 |
plan tests => 4; |
457 |
plan tests => 4; |
| 458 |
|
458 |
|
|
Lines 471-489
subtest '->get_effective_email' => sub {
Link Here
|
| 471 |
t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'admin@mylibrary.com' ); |
471 |
t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'admin@mylibrary.com' ); |
| 472 |
t::lib::Mocks::mock_preference( 'ReplytoDefault', 'reply@mylibrary.com' ); |
472 |
t::lib::Mocks::mock_preference( 'ReplytoDefault', 'reply@mylibrary.com' ); |
| 473 |
|
473 |
|
| 474 |
is( $library_1->get_effective_email, $library_1->branchreplyto, |
474 |
is( $library_1->inbound_email_address, $library_1->branchreplyto, |
| 475 |
'If defined, use branches replyto address'); |
475 |
'If defined, use branches replyto address'); |
| 476 |
|
476 |
|
| 477 |
$library_1->branchreplyto(undef)->store(); |
477 |
$library_1->branchreplyto(undef)->store(); |
| 478 |
is( $library_1->get_effective_email, $library_1->branchemail, |
478 |
is( $library_1->inbound_email_address, $library_1->branchemail, |
| 479 |
'Fallback to branches email address when branchreplyto is undefined'); |
479 |
'Fallback to branches email address when branchreplyto is undefined'); |
| 480 |
|
480 |
|
| 481 |
$library_1->branchemail(undef)->store(); |
481 |
$library_1->branchemail(undef)->store(); |
| 482 |
is( $library_1->get_effective_email, 'reply@mylibrary.com', |
482 |
is( $library_1->inbound_email_address, 'reply@mylibrary.com', |
| 483 |
'Fallback to ReplytoDefault email address when branchreplyto and branchemail are undefined'); |
483 |
'Fallback to ReplytoDefault email address when branchreplyto and branchemail are undefined'); |
| 484 |
|
484 |
|
| 485 |
t::lib::Mocks::mock_preference( 'ReplytoDefault', undef ); |
485 |
t::lib::Mocks::mock_preference( 'ReplytoDefault', undef ); |
| 486 |
is( $library_1->get_effective_email, 'admin@mylibrary.com', |
486 |
is( $library_1->inbound_email_address, 'admin@mylibrary.com', |
| 487 |
'Fallback to KohaAdminEmailAddress email address when branchreplyto, branchemail and eplytoDefault are undefined'); |
487 |
'Fallback to KohaAdminEmailAddress email address when branchreplyto, branchemail and eplytoDefault are undefined'); |
| 488 |
|
488 |
|
| 489 |
$schema->storage->txn_rollback; |
489 |
$schema->storage->txn_rollback; |
| 490 |
- |
|
|