Browse Source

Bug 29857: (follow-up) Fix t/Koha/Email.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
22.05.x
Tomás Cohen Arazi 2 years ago
committed by Fridolin Somers
parent
commit
d0e6731075
  1. 16
      t/Koha/Email.t

16
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' );
};
};

Loading…
Cancel
Save