|
Lines 107-113
subtest 'create() tests' => sub {
Link Here
|
| 107 |
'Koha::Exceptions::BadParameter', |
107 |
'Koha::Exceptions::BadParameter', |
| 108 |
'Exception thrown correctly'; |
108 |
'Exception thrown correctly'; |
| 109 |
|
109 |
|
| 110 |
is( "$@", q{Invalid 'from' parameter: not_an_email}, 'Exception message correct' ); |
110 |
like( "$@", qr/Invalid 'from' parameter: not_an_email/, 'Exception message correct' ); |
| 111 |
|
111 |
|
| 112 |
t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'not_an_email' ); |
112 |
t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'not_an_email' ); |
| 113 |
|
113 |
|
|
Lines 116-122
subtest 'create() tests' => sub {
Link Here
|
| 116 |
'Koha::Exceptions::BadParameter', |
116 |
'Koha::Exceptions::BadParameter', |
| 117 |
'Exception thrown correctly'; |
117 |
'Exception thrown correctly'; |
| 118 |
|
118 |
|
| 119 |
is( "$@", q{Invalid 'from' parameter: not_an_email}, 'Exception message correct' ); |
119 |
like( "$@", qr/Invalid 'from' parameter: not_an_email/, 'Exception message correct' ); |
| 120 |
|
120 |
|
| 121 |
t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'tomasito@mail.com' ); |
121 |
t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'tomasito@mail.com' ); |
| 122 |
t::lib::Mocks::mock_preference( 'SendAllEmailsTo', undef ); |
122 |
t::lib::Mocks::mock_preference( 'SendAllEmailsTo', undef ); |
|
Lines 126-132
subtest 'create() tests' => sub {
Link Here
|
| 126 |
'Koha::Exceptions::BadParameter', |
126 |
'Koha::Exceptions::BadParameter', |
| 127 |
'Exception thrown correctly'; |
127 |
'Exception thrown correctly'; |
| 128 |
|
128 |
|
| 129 |
is( "$@", q{Invalid 'to' parameter: not_an_email}, 'Exception message correct' ); |
129 |
like( "$@", qr/Invalid 'to' parameter: not_an_email/, 'Exception message correct' ); |
| 130 |
|
130 |
|
| 131 |
t::lib::Mocks::mock_preference( 'SendAllEmailsTo', 'not_an_email' ); |
131 |
t::lib::Mocks::mock_preference( 'SendAllEmailsTo', 'not_an_email' ); |
| 132 |
|
132 |
|
|
Lines 135-141
subtest 'create() tests' => sub {
Link Here
|
| 135 |
'Koha::Exceptions::BadParameter', |
135 |
'Koha::Exceptions::BadParameter', |
| 136 |
'Exception thrown correctly'; |
136 |
'Exception thrown correctly'; |
| 137 |
|
137 |
|
| 138 |
is( "$@", q{Invalid 'to' parameter: not_an_email}, 'Exception message correct' ); |
138 |
like( "$@", qr/Invalid 'to' parameter: not_an_email/, 'Exception message correct' ); |
| 139 |
|
139 |
|
| 140 |
t::lib::Mocks::mock_preference( 'SendAllEmailsTo', undef ); |
140 |
t::lib::Mocks::mock_preference( 'SendAllEmailsTo', undef ); |
| 141 |
|
141 |
|
|
Lines 149-155
subtest 'create() tests' => sub {
Link Here
|
| 149 |
'Koha::Exceptions::BadParameter', |
149 |
'Koha::Exceptions::BadParameter', |
| 150 |
'Exception thrown correctly'; |
150 |
'Exception thrown correctly'; |
| 151 |
|
151 |
|
| 152 |
is( "$@", q{Invalid 'reply_to' parameter: not_an_email}, 'Exception message correct' ); |
152 |
like( "$@", qr/Invalid 'reply_to' parameter: not_an_email/, 'Exception message correct' ); |
| 153 |
|
153 |
|
| 154 |
throws_ok |
154 |
throws_ok |
| 155 |
{ Koha::Email->create( |
155 |
{ Koha::Email->create( |
|
Lines 161-167
subtest 'create() tests' => sub {
Link Here
|
| 161 |
'Koha::Exceptions::BadParameter', |
161 |
'Koha::Exceptions::BadParameter', |
| 162 |
'Exception thrown correctly'; |
162 |
'Exception thrown correctly'; |
| 163 |
|
163 |
|
| 164 |
is( "$@", q{Invalid 'sender' parameter: not_an_email}, 'Exception message correct' ); |
164 |
like( "$@", qr/Invalid 'sender' parameter: not_an_email/, 'Exception message correct' ); |
| 165 |
|
165 |
|
| 166 |
throws_ok |
166 |
throws_ok |
| 167 |
{ Koha::Email->create( |
167 |
{ Koha::Email->create( |
|
Lines 173-179
subtest 'create() tests' => sub {
Link Here
|
| 173 |
'Koha::Exceptions::BadParameter', |
173 |
'Koha::Exceptions::BadParameter', |
| 174 |
'Exception thrown correctly'; |
174 |
'Exception thrown correctly'; |
| 175 |
|
175 |
|
| 176 |
is( "$@", q{Invalid 'cc' parameter: not_an_email}, 'Exception message correct' ); |
176 |
like( "$@", qr/Invalid 'cc' parameter: not_an_email/, 'Exception message correct' ); |
| 177 |
|
177 |
|
| 178 |
throws_ok |
178 |
throws_ok |
| 179 |
{ Koha::Email->create( |
179 |
{ Koha::Email->create( |
|
Lines 185-191
subtest 'create() tests' => sub {
Link Here
|
| 185 |
'Koha::Exceptions::BadParameter', |
185 |
'Koha::Exceptions::BadParameter', |
| 186 |
'Exception thrown correctly'; |
186 |
'Exception thrown correctly'; |
| 187 |
|
187 |
|
| 188 |
is( "$@", q{Invalid 'bcc' parameter: not_an_email}, 'Exception message correct' ); |
188 |
like( "$@", qr/Invalid 'bcc' parameter: not_an_email/, 'Exception message correct' ); |
| 189 |
}; |
189 |
}; |
| 190 |
}; |
190 |
}; |
| 191 |
|
191 |
|
| 192 |
- |
|
|