|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 21; |
22 |
use Test::More tests => 23; |
| 23 |
use Test::Exception; |
23 |
use Test::Exception; |
| 24 |
use Test::Warn; |
24 |
use Test::Warn; |
| 25 |
|
25 |
|
|
Lines 1351-1356
subtest 'notify_library_of_registration()' => sub {
Link Here
|
| 1351 |
$schema->storage->txn_rollback; |
1351 |
$schema->storage->txn_rollback; |
| 1352 |
}; |
1352 |
}; |
| 1353 |
|
1353 |
|
|
|
1354 |
subtest 'notice_email_address' => sub { |
| 1355 |
plan tests => 2; |
| 1356 |
|
| 1357 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
| 1358 |
|
| 1359 |
t::lib::Mocks::mock_preference( 'EmailFieldPrecedence', 'email|emailpro' ); |
| 1360 |
t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'OFF' ); |
| 1361 |
is ($patron->notice_email_address, $patron->email, "Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is off"); |
| 1362 |
|
| 1363 |
t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'emailpro' ); |
| 1364 |
is ($patron->notice_email_address, $patron->emailpro, "Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is emailpro"); |
| 1365 |
|
| 1366 |
$patron->delete; |
| 1367 |
}; |
| 1368 |
|
| 1369 |
subtest 'first_valid_email_address' => sub { |
| 1370 |
plan tests => 1; |
| 1371 |
|
| 1372 |
my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { emailpro => ''}}); |
| 1373 |
|
| 1374 |
t::lib::Mocks::mock_preference( 'EmailFieldPrecedence', 'emailpro|email' ); |
| 1375 |
is ($patron->first_valid_email_address, $patron->email, "Koha::Patron->first_valid_email_address returns correct value when EmailFieldPrecedence is 'emailpro|email' and emailpro is empty"); |
| 1376 |
|
| 1377 |
$patron->delete; |
| 1378 |
}; |
| 1379 |
|
| 1354 |
subtest 'get_savings tests' => sub { |
1380 |
subtest 'get_savings tests' => sub { |
| 1355 |
|
1381 |
|
| 1356 |
plan tests => 4; |
1382 |
plan tests => 4; |