Bug 18570: Tests to prove if email send was attempted

kshell
prove -v t/db_dependent/Passwordrecovery.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Mark Tompsett 2018-03-07 23:59:54 +00:00 committed by Nick Clemens
parent 7852d967d1
commit 63d7065abc
1 changed files with 6 additions and 1 deletions

View File

@ -23,7 +23,7 @@ use Koha::Database;
use Koha::Patrons;
use t::lib::TestBuilder;
use Test::More tests => 18;
use Test::More tests => 20;
use_ok('Koha::Patron::Password::Recovery');
@ -192,5 +192,10 @@ $letters = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber1,
ok( $tempuuid1 ne $tempuuid2, "[SendPasswordRecoveryEmail] UPDATE == ON changes uuid in the database and updates the expirydate");
ok( scalar @$letters == 2, "[SendPasswordRecoveryEmail] UPDATE == ON sends a new letter with updated uuid");
foreach my $letter (@$letters) {
ok( $letter->{status} eq 'failed',
'Test SendPasswordRecoverEmail failed due to TestBuilder Sender not being a valid email address as expected.' );
}
$schema->storage->txn_rollback();