Lines 33-39
use t::lib::Mocks;
Link Here
|
33 |
use t::lib::TestBuilder; |
33 |
use t::lib::TestBuilder; |
34 |
|
34 |
|
35 |
BEGIN { |
35 |
BEGIN { |
36 |
use_ok('C4::Members', qw( GetBorrowersToExpunge DeleteUnverifiedOpacRegistrations DeleteExpiredOpacRegistrations )); |
36 |
use_ok('C4::Members', qw( GetBorrowersToExpunge DeleteExpiredOpacRegistrations )); |
37 |
} |
37 |
} |
38 |
|
38 |
|
39 |
my $schema = Koha::Database->schema; |
39 |
my $schema = Koha::Database->schema; |
Lines 389-406
$borrower = Koha::Patrons->find( $borrowernumber )->unblessed;
Link Here
|
389 |
ok( $borrower->{userid}, 'A userid should have been generated correctly' ); |
389 |
ok( $borrower->{userid}, 'A userid should have been generated correctly' ); |
390 |
|
390 |
|
391 |
subtest 'purgeSelfRegistration' => sub { |
391 |
subtest 'purgeSelfRegistration' => sub { |
392 |
plan tests => 8; |
392 |
plan tests => 7; |
393 |
|
|
|
394 |
#purge unverified |
395 |
my $d=360; |
396 |
C4::Members::DeleteUnverifiedOpacRegistrations($d); |
397 |
foreach(1..3) { |
398 |
$dbh->do("INSERT INTO borrower_modifications (timestamp, borrowernumber, verification_token, changed_fields) VALUES ('2014-01-01 01:02:03',0,?,'firstname,surname')", undef, (scalar localtime)."_$_"); |
399 |
} |
400 |
# Add a record with a borrowernumber which should not be deleted by DeleteUnverifiedOpacRegistrations |
401 |
# NOTE: We are using the borrowernumber from the last test outside this subtest |
402 |
$dbh->do( "INSERT INTO borrower_modifications (timestamp, borrowernumber, verification_token, changed_fields) VALUES ('2014-01-01 01:02:03', ?, '', 'firstname,surname' )", undef, $borrowernumber ); |
403 |
is( C4::Members::DeleteUnverifiedOpacRegistrations($d), 3, 'Test for DeleteUnverifiedOpacRegistrations' ); |
404 |
|
393 |
|
405 |
#purge members in temporary category |
394 |
#purge members in temporary category |
406 |
my $c= 'XYZ'; |
395 |
my $c= 'XYZ'; |
407 |
- |
|
|