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

(-)a/t/db_dependent/Koha/Libraries.t (-2 / +38 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 9;
22
use Test::More tests => 10;
23
23
24
use C4::Biblio;
24
use C4::Biblio;
25
use C4::Context;
25
use C4::Context;
Lines 452-457 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 {
456
457
    plan tests => 4;
458
459
    $schema->storage->txn_begin;
460
461
    my $library_1 = $builder->build_object(
462
        {
463
            class => 'Koha::Libraries',
464
            value => {
465
                branchemail   => 'from@mybranc.com',
466
                branchreplyto => 'reply@mybranch.com'
467
            }
468
        }
469
    );
470
471
    t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'admin@mylibrary.com' );
472
    t::lib::Mocks::mock_preference( 'ReplytoDefault', 'reply@mylibrary.com' );
473
474
    is( $library_1->get_effective_email, $library_1->branchreplyto,
475
       'If defined, use branches replyto address');
476
477
    $library_1->branchreplyto(undef)->store();
478
    is( $library_1->get_effective_email, $library_1->branchemail,
479
       'Fallback to branches email address when branchreplyto is undefined');
480
481
    $library_1->branchemail(undef)->store();
482
    is( $library_1->get_effective_email, 'reply@mylibrary.com',
483
       'Fallback to ReplytoDefault email address when branchreplyto and branchemail are undefined');
484
485
    t::lib::Mocks::mock_preference( 'ReplytoDefault', undef );
486
    is( $library_1->get_effective_email, 'admin@mylibrary.com',
487
       'Fallback to KohaAdminEmailAddress email address when branchreplyto, branchemail and eplytoDefault are undefined');
488
489
    $schema->storage->txn_rollback;
490
};
491
455
subtest 'cash_registers' => sub {
492
subtest 'cash_registers' => sub {
456
    plan tests => 3;
493
    plan tests => 3;
457
494
458
- 

Return to bug 22823