@@ -45,6 +45,7 @@ protected function setUp()
45
45
46
46
/**
47
47
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
48
+ * @magentoConfigFixture default_store sendfriend/email/enabled 1
48
49
* @magentoConfigFixture default_store sendfriend/email/allow_guest 1
49
50
*/
50
51
public function testSendFriendGuestEnable ()
@@ -66,6 +67,7 @@ public function testSendFriendGuestEnable()
66
67
67
68
/**
68
69
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
70
+ * @magentoConfigFixture default_store sendfriend/email/enabled 1
69
71
* @magentoConfigFixture default_store sendfriend/email/allow_guest 0
70
72
* @expectedException \Exception
71
73
* @expectedExceptionMessage The current customer isn't authorized.
@@ -90,9 +92,11 @@ public function testSendFriendGuestDisableAsGuest()
90
92
/**
91
93
* @magentoApiDataFixture Magento/Customer/_files/customer.php
92
94
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
93
- * @magentoConfigFixture default_store sendfriend/email/allow_guest 0
95
+ * @magentoConfigFixture default_store sendfriend/email/enabled 0
96
+ * @expectedException \Exception
97
+ * @expectedExceptionMessage "Email to a Friend" is not enabled.
94
98
*/
95
- public function testSendFriendGuestDisableAsCustomer ()
99
+ public function testSendFriendDisableAsCustomer ()
96
100
{
97
101
$ productId = (int )$ this ->productRepository ->get ('simple_product ' )->getId ();
98
102
$ recipients = '{
@@ -111,6 +115,9 @@ public function testSendFriendGuestDisableAsCustomer()
111
115
112
116
/**
113
117
* @magentoApiDataFixture Magento/Customer/_files/customer.php
118
+ * @magentoConfigFixture default_store sendfriend/email/enabled 1
119
+ * @expectedException \Exception
120
+ * @expectedExceptionMessage The product that was requested doesn't exist. Verify the product and try again.
114
121
*/
115
122
public function testSendWithoutExistProduct ()
116
123
{
@@ -125,15 +132,13 @@ public function testSendWithoutExistProduct()
125
132
} ' ;
126
133
$ query = $ this ->getQuery ($ productId , $ recipients );
127
134
128
- $ this ->expectExceptionMessage (
129
- 'The product that was requested doesn \'t exist. Verify the product and try again. '
130
- );
131
135
$ this ->graphQlMutation ($ query , [], '' , $ this ->getHeaderMap ());
132
136
}
133
137
134
138
/**
135
139
* @magentoApiDataFixture Magento/Customer/_files/customer.php
136
140
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
141
+ * @magentoConfigFixture default_store sendfriend/email/enabled 1
137
142
*/
138
143
public function testMaxSendEmailToFriend ()
139
144
{
@@ -176,6 +181,7 @@ public function testMaxSendEmailToFriend()
176
181
/**
177
182
* @magentoApiDataFixture Magento/Customer/_files/customer.php
178
183
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
184
+ * @magentoConfigFixture default_store sendfriend/email/enabled 1
179
185
* @dataProvider sendFriendsErrorsDataProvider
180
186
* @param string $input
181
187
* @param string $errorMessage
@@ -188,7 +194,7 @@ public function testErrors(string $input, string $errorMessage)
188
194
sendEmailToFriend(
189
195
input: {
190
196
$ input
191
- }
197
+ }
192
198
) {
193
199
sender {
194
200
name
@@ -210,6 +216,7 @@ public function testErrors(string $input, string $errorMessage)
210
216
/**
211
217
* @magentoApiDataFixture Magento/Customer/_files/customer.php
212
218
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
219
+ * @magentoConfigFixture default_store sendfriend/email/enabled 1
213
220
* @magentoConfigFixture default_store sendfriend/email/max_per_hour 1
214
221
* @magentoApiDataFixture Magento/SendFriend/Fixtures/sendfriend_configuration.php
215
222
*/
@@ -238,6 +245,7 @@ public function testLimitMessagesPerHour()
238
245
/**
239
246
* @magentoApiDataFixture Magento/Customer/_files/customer.php
240
247
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
248
+ * @magentoConfigFixture default_store sendfriend/email/enabled 1
241
249
*/
242
250
public function testSendProductWithoutSenderEmail ()
243
251
{
@@ -256,6 +264,7 @@ public function testSendProductWithoutSenderEmail()
256
264
/**
257
265
* @magentoApiDataFixture Magento/Customer/_files/customer.php
258
266
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product_without_visibility.php
267
+ * @magentoConfigFixture default_store sendfriend/email/enabled 1
259
268
*/
260
269
public function testSendProductWithoutVisibility ()
261
270
{
@@ -282,12 +291,12 @@ public function sendFriendsErrorsDataProvider()
282
291
{
283
292
return [
284
293
[
285
- 'product_id: 1
294
+ 'product_id: 1
286
295
sender: {
287
296
name: "Name"
288
297
email: "e@mail.com"
289
298
message: "Lorem Ipsum"
290
- }
299
+ }
291
300
recipients: [
292
301
{
293
302
name: ""
@@ -300,12 +309,12 @@ public function sendFriendsErrorsDataProvider()
300
309
] ' , 'Please provide Name for all of recipients. '
301
310
],
302
311
[
303
- 'product_id: 1
312
+ 'product_id: 1
304
313
sender: {
305
314
name: "Name"
306
315
email: "e@mail.com"
307
316
message: "Lorem Ipsum"
308
- }
317
+ }
309
318
recipients: [
310
319
{
311
320
name: "Recipient Name 1"
@@ -318,12 +327,12 @@ public function sendFriendsErrorsDataProvider()
318
327
] ' , 'Please provide Email for all of recipients. '
319
328
],
320
329
[
321
- 'product_id: 1
330
+ 'product_id: 1
322
331
sender: {
323
332
name: ""
324
333
email: "e@mail.com"
325
334
message: "Lorem Ipsum"
326
- }
335
+ }
327
336
recipients: [
328
337
{
329
338
name: "Recipient Name 1"
@@ -336,12 +345,12 @@ public function sendFriendsErrorsDataProvider()
336
345
] ' , 'Please provide Name of sender. '
337
346
],
338
347
[
339
- 'product_id: 1
348
+ 'product_id: 1
340
349
sender: {
341
350
name: "Name"
342
351
email: "e@mail.com"
343
352
message: ""
344
- }
353
+ }
345
354
recipients: [
346
355
{
347
356
name: "Recipient Name 1"
@@ -403,9 +412,9 @@ private function getQuery(int $productId, string $recipients): string
403
412
name: "Name"
404
413
email: "e@mail.com"
405
414
message: "Lorem Ipsum"
406
- }
415
+ }
407
416
recipients: [ {$ recipients }]
408
- }
417
+ }
409
418
) {
410
419
sender {
411
420
name
0 commit comments