Lines 1791-1797
subtest 'notify_library_of_registration()' => sub {
Link Here
|
1791 |
|
1791 |
|
1792 |
subtest 'notice_email_address() tests' => sub { |
1792 |
subtest 'notice_email_address() tests' => sub { |
1793 |
|
1793 |
|
1794 |
plan tests => 3; |
1794 |
plan tests => 5; |
1795 |
|
1795 |
|
1796 |
$schema->storage->txn_begin; |
1796 |
$schema->storage->txn_begin; |
1797 |
|
1797 |
|
Lines 1817-1822
subtest 'notice_email_address() tests' => sub {
Link Here
|
1817 |
"Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is 'MULTI' and EmailFieldSelection is 'email,emailpro'" |
1817 |
"Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is 'MULTI' and EmailFieldSelection is 'email,emailpro'" |
1818 |
); |
1818 |
); |
1819 |
|
1819 |
|
|
|
1820 |
my $invalid = 'potato'; |
1821 |
|
1822 |
t::lib::Mocks::mock_preference( 'EmailFieldPrecedence', 'email|emailpro' ); |
1823 |
t::lib::Mocks::mock_preference( 'EmailFieldPrimary', $invalid ); |
1824 |
|
1825 |
my $email; |
1826 |
warning_is { $email = $patron->notice_email_address(); } |
1827 |
qq{Invalid value for EmailFieldPrimary ($invalid)}, |
1828 |
'Warning correctly generated on invalid system preference'; |
1829 |
|
1830 |
is( |
1831 |
$email, $patron->email, |
1832 |
"Koha::Patron->notice_email_address falls back to correct value when EmailFieldPrimary is invalid" |
1833 |
); |
1834 |
|
1820 |
$schema->storage->txn_rollback; |
1835 |
$schema->storage->txn_rollback; |
1821 |
}; |
1836 |
}; |
1822 |
|
1837 |
|
1823 |
- |
|
|