|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 19; |
22 |
use Test::More tests => 20; |
| 23 |
use Test::Exception; |
23 |
use Test::Exception; |
| 24 |
use Test::Warn; |
24 |
use Test::Warn; |
| 25 |
|
25 |
|
|
Lines 28-33
use Koha::Database;
Link Here
|
| 28 |
use Koha::DateUtils qw(dt_from_string); |
28 |
use Koha::DateUtils qw(dt_from_string); |
| 29 |
use Koha::ArticleRequests; |
29 |
use Koha::ArticleRequests; |
| 30 |
use Koha::Patrons; |
30 |
use Koha::Patrons; |
|
|
31 |
use Koha::Patron::Consents; |
| 31 |
use Koha::Patron::Relationships; |
32 |
use Koha::Patron::Relationships; |
| 32 |
|
33 |
|
| 33 |
use t::lib::TestBuilder; |
34 |
use t::lib::TestBuilder; |
|
Lines 1345-1350
subtest 'notify_library_of_registration()' => sub {
Link Here
|
| 1345 |
$to_address = $sth->fetchrow_array; |
1346 |
$to_address = $sth->fetchrow_array; |
| 1346 |
is( $to_address, 'root@localhost', 'OPAC_REG email queued to go to KohaAdminEmailAddress syspref when EmailPatronRegistration equals KohaAdminEmailAddress' ); |
1347 |
is( $to_address, 'root@localhost', 'OPAC_REG email queued to go to KohaAdminEmailAddress syspref when EmailPatronRegistration equals KohaAdminEmailAddress' ); |
| 1347 |
$dbh->do(q|DELETE FROM message_queue|); |
1348 |
$dbh->do(q|DELETE FROM message_queue|); |
|
|
1349 |
$schema->storage->txn_rollback; |
| 1350 |
}; |
| 1351 |
|
| 1352 |
subtest 'test patron_consent' => sub { |
| 1353 |
plan tests => 4; |
| 1354 |
$schema->storage->txn_begin; |
| 1355 |
|
| 1356 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
| 1357 |
throws_ok { $patron->consent } 'Koha::Exceptions::MissingParameter', 'missing type'; |
| 1358 |
|
| 1359 |
my $consent = $patron->consent('GDPR_PROCESSING'); |
| 1360 |
is( ref $consent, 'Koha::Patron::Consent', 'return type check' ); |
| 1361 |
$consent->given_on( '2021-02-03' )->store; |
| 1362 |
undef $consent; |
| 1363 |
is( $patron->consent('GDPR_PROCESSING')->given_on, '2021-02-03 00:00:00', 'check date' ); |
| 1364 |
|
| 1365 |
is( $patron->consent('NOT_EXIST')->refused_on, undef, 'New empty object for new type' ); |
| 1348 |
|
1366 |
|
| 1349 |
$schema->storage->txn_rollback; |
1367 |
$schema->storage->txn_rollback; |
| 1350 |
}; |
1368 |
}; |
| 1351 |
- |
|
|