From d0e6731075347c38171747be85cf1a74147cd028 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 2 Mar 2022 09:55:32 -0300 Subject: [PATCH] Bug 29857: (follow-up) Fix t/Koha/Email.t Signed-off-by: Tomas Cohen Arazi Signed-off-by: Fridolin Somers --- t/Koha/Email.t | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/t/Koha/Email.t b/t/Koha/Email.t index e89e807186..dbd17834ba 100755 --- a/t/Koha/Email.t +++ b/t/Koha/Email.t @@ -107,7 +107,7 @@ subtest 'create() tests' => sub { 'Koha::Exceptions::BadParameter', 'Exception thrown correctly'; - is( "$@", q{Invalid 'from' parameter: not_an_email}, 'Exception message correct' ); + like( "$@", qr/Invalid 'from' parameter: not_an_email/, 'Exception message correct' ); t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'not_an_email' ); @@ -116,7 +116,7 @@ subtest 'create() tests' => sub { 'Koha::Exceptions::BadParameter', 'Exception thrown correctly'; - is( "$@", q{Invalid 'from' parameter: not_an_email}, 'Exception message correct' ); + like( "$@", qr/Invalid 'from' parameter: not_an_email/, 'Exception message correct' ); t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'tomasito@mail.com' ); t::lib::Mocks::mock_preference( 'SendAllEmailsTo', undef ); @@ -126,7 +126,7 @@ subtest 'create() tests' => sub { 'Koha::Exceptions::BadParameter', 'Exception thrown correctly'; - is( "$@", q{Invalid 'to' parameter: not_an_email}, 'Exception message correct' ); + like( "$@", qr/Invalid 'to' parameter: not_an_email/, 'Exception message correct' ); t::lib::Mocks::mock_preference( 'SendAllEmailsTo', 'not_an_email' ); @@ -135,7 +135,7 @@ subtest 'create() tests' => sub { 'Koha::Exceptions::BadParameter', 'Exception thrown correctly'; - is( "$@", q{Invalid 'to' parameter: not_an_email}, 'Exception message correct' ); + like( "$@", qr/Invalid 'to' parameter: not_an_email/, 'Exception message correct' ); t::lib::Mocks::mock_preference( 'SendAllEmailsTo', undef ); @@ -149,7 +149,7 @@ subtest 'create() tests' => sub { 'Koha::Exceptions::BadParameter', 'Exception thrown correctly'; - is( "$@", q{Invalid 'reply_to' parameter: not_an_email}, 'Exception message correct' ); + like( "$@", qr/Invalid 'reply_to' parameter: not_an_email/, 'Exception message correct' ); throws_ok { Koha::Email->create( @@ -161,7 +161,7 @@ subtest 'create() tests' => sub { 'Koha::Exceptions::BadParameter', 'Exception thrown correctly'; - is( "$@", q{Invalid 'sender' parameter: not_an_email}, 'Exception message correct' ); + like( "$@", qr/Invalid 'sender' parameter: not_an_email/, 'Exception message correct' ); throws_ok { Koha::Email->create( @@ -173,7 +173,7 @@ subtest 'create() tests' => sub { 'Koha::Exceptions::BadParameter', 'Exception thrown correctly'; - is( "$@", q{Invalid 'cc' parameter: not_an_email}, 'Exception message correct' ); + like( "$@", qr/Invalid 'cc' parameter: not_an_email/, 'Exception message correct' ); throws_ok { Koha::Email->create( @@ -185,7 +185,7 @@ subtest 'create() tests' => sub { 'Koha::Exceptions::BadParameter', 'Exception thrown correctly'; - is( "$@", q{Invalid 'bcc' parameter: not_an_email}, 'Exception message correct' ); + like( "$@", qr/Invalid 'bcc' parameter: not_an_email/, 'Exception message correct' ); }; }; -- 2.39.5