From 5d2b3fe488409d59aa92d9b1de72c85dfb093834 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 28 Aug 2024 14:56:44 -0300 Subject: [PATCH] Bug 37757: Unit tests Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer (cherry picked from commit 24f84f11a29178a42c45dc3500d8742a6df571d9) Signed-off-by: Lucas Gass --- t/db_dependent/Koha/Patron.t | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t index 2e11ab3d4a..7bc32360b4 100755 --- a/t/db_dependent/Koha/Patron.t +++ b/t/db_dependent/Koha/Patron.t @@ -1838,17 +1838,19 @@ subtest 'notify_library_of_registration()' => sub { $schema->storage->txn_rollback; }; -subtest 'notice_email_address' => sub { +subtest 'notice_email_address() tests' => sub { + plan tests => 3; + $schema->storage->txn_begin; my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); t::lib::Mocks::mock_preference( 'EmailFieldPrecedence', 'email|emailpro' ); - t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'OFF' ); + t::lib::Mocks::mock_preference( 'EmailFieldPrimary', undef ); is( $patron->notice_email_address, $patron->email, - "Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is off" + "Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is not defined" ); t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'emailpro' ); @@ -1864,7 +1866,6 @@ subtest 'notice_email_address' => sub { "Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is 'MULTI' and EmailFieldSelection is 'email,emailpro'" ); - $patron->delete; $schema->storage->txn_rollback; };