|
Lines 403-409
$borrower = Koha::Patrons->find( $borrowernumber )->unblessed;
Link Here
|
| 403 |
ok( $borrower->{userid}, 'A userid should have been generated correctly' ); |
403 |
ok( $borrower->{userid}, 'A userid should have been generated correctly' ); |
| 404 |
|
404 |
|
| 405 |
subtest 'purgeSelfRegistration' => sub { |
405 |
subtest 'purgeSelfRegistration' => sub { |
| 406 |
plan tests => 5; |
406 |
plan tests => 8; |
| 407 |
|
407 |
|
| 408 |
#purge unverified |
408 |
#purge unverified |
| 409 |
my $d=360; |
409 |
my $d=360; |
|
Lines 417-423
subtest 'purgeSelfRegistration' => sub {
Link Here
|
| 417 |
my $c= 'XYZ'; |
417 |
my $c= 'XYZ'; |
| 418 |
$dbh->do("INSERT IGNORE INTO categories (categorycode) VALUES ('$c')"); |
418 |
$dbh->do("INSERT IGNORE INTO categories (categorycode) VALUES ('$c')"); |
| 419 |
t::lib::Mocks::mock_preference('PatronSelfRegistrationDefaultCategory', $c ); |
419 |
t::lib::Mocks::mock_preference('PatronSelfRegistrationDefaultCategory', $c ); |
| 420 |
t::lib::Mocks::mock_preference('PatronSelfRegistrationExpireTemporaryAccountsDelay', 360); |
|
|
| 421 |
C4::Members::DeleteExpiredOpacRegistrations(); |
420 |
C4::Members::DeleteExpiredOpacRegistrations(); |
| 422 |
my $self_reg = $builder->build_object({ |
421 |
my $self_reg = $builder->build_object({ |
| 423 |
class => 'Koha::Patrons', |
422 |
class => 'Koha::Patrons', |
|
Lines 427-432
subtest 'purgeSelfRegistration' => sub {
Link Here
|
| 427 |
} |
426 |
} |
| 428 |
}); |
427 |
}); |
| 429 |
|
428 |
|
|
|
429 |
# First test if empty PatronSelfRegistrationExpireTemporaryAccountsDelay returns zero |
| 430 |
t::lib::Mocks::mock_preference('PatronSelfRegistrationExpireTemporaryAccountsDelay', q{} ); |
| 431 |
is( C4::Members::DeleteExpiredOpacRegistrations(), 0, "DeleteExpiredOpacRegistrations with empty delay" ); |
| 432 |
# Test zero too |
| 433 |
t::lib::Mocks::mock_preference('PatronSelfRegistrationExpireTemporaryAccountsDelay', 0 ); |
| 434 |
is( C4::Members::DeleteExpiredOpacRegistrations(), 0, "DeleteExpiredOpacRegistrations with delay 0" ); |
| 435 |
# Also check empty category |
| 436 |
t::lib::Mocks::mock_preference('PatronSelfRegistrationDefaultCategory', q{} ); |
| 437 |
t::lib::Mocks::mock_preference('PatronSelfRegistrationExpireTemporaryAccountsDelay', 360 ); |
| 438 |
is( C4::Members::DeleteExpiredOpacRegistrations(), 0, "DeleteExpiredOpacRegistrations with empty category" ); |
| 439 |
t::lib::Mocks::mock_preference('PatronSelfRegistrationDefaultCategory', $c ); |
| 440 |
|
| 430 |
my $checkout = $builder->build_object({ |
441 |
my $checkout = $builder->build_object({ |
| 431 |
class=>'Koha::Checkouts', |
442 |
class=>'Koha::Checkouts', |
| 432 |
value=>{ |
443 |
value=>{ |
| 433 |
- |
|
|