View | Details | Raw Unified | Return to bug 20474
Collapse All | Expand All

(-)a/t/db_dependent/Passwordrecovery.t (-6 / +5 lines)
Lines 34-40 my $module = Test::MockModule->new('Mail::Sendmail'); Link Here
34
$module->mock(
34
$module->mock(
35
    'sendmail',
35
    'sendmail',
36
    sub {
36
    sub {
37
        carp 'Fake sendmail!';
37
        carp 'Fake sendmail';
38
        %mail = @_;
38
        %mail = @_;
39
    }
39
    }
40
);
40
);
Lines 195-203 ok( Koha::Patron::Password::Recovery::DeleteExpiredPasswordRecovery($borrowernum Link Here
195
195
196
my $borrower = Koha::Patrons->search( { userid => $userid1 } )->next;
196
my $borrower = Koha::Patrons->search( { userid => $userid1 } )->next;
197
my $success;
197
my $success;
198
warning_like {
198
warning_is {
199
    $success = Koha::Patron::Password::Recovery::SendPasswordRecoveryEmail($borrower, $email1, 0); }
199
    $success = Koha::Patron::Password::Recovery::SendPasswordRecoveryEmail($borrower, $email1, 0); }
200
    qr/Fake sendmail!/,
200
    "Fake sendmail",
201
    '[SendPasswordRecoveryEmail] expecting fake sendmail';
201
    '[SendPasswordRecoveryEmail] expecting fake sendmail';
202
ok( $success == 1, '[SendPasswordRecoveryEmail] Returns 1 on success');
202
ok( $success == 1, '[SendPasswordRecoveryEmail] Returns 1 on success');
203
203
Lines 207-215 ok( scalar @$letters == 1, "[SendPasswordRecoveryEmail] There is a letter in the Link Here
207
my $bpr = $schema->resultset('BorrowerPasswordRecovery')->search( { borrowernumber => $borrowernumber1 } );
207
my $bpr = $schema->resultset('BorrowerPasswordRecovery')->search( { borrowernumber => $borrowernumber1 } );
208
my $tempuuid1 = $bpr->next->uuid;
208
my $tempuuid1 = $bpr->next->uuid;
209
209
210
warning_like {
210
warning_is {
211
    Koha::Patron::Password::Recovery::SendPasswordRecoveryEmail($borrower, $email1, 1); }
211
    Koha::Patron::Password::Recovery::SendPasswordRecoveryEmail($borrower, $email1, 1); }
212
    qr/Fake sendmail!/,
212
    "Fake sendmail",
213
    '[SendPasswordRecoveryEmail] expecting fake sendmail';
213
    '[SendPasswordRecoveryEmail] expecting fake sendmail';
214
214
215
$bpr = $schema->resultset('BorrowerPasswordRecovery')->search( { borrowernumber => $borrowernumber1 } );
215
$bpr = $schema->resultset('BorrowerPasswordRecovery')->search( { borrowernumber => $borrowernumber1 } );
216
- 

Return to bug 20474