17
17
*
18
18
* @magentoAppArea frontend
19
19
*/
20
- class CaseCheckUnsuccessfulAddingProductReviewTest extends AbstractController
20
+ class CaseCheckAddingProductReviewTest extends AbstractController
21
21
{
22
22
/**
23
23
* Test adding a review for allowed guests with incomplete data by a not logged in user
24
24
*
25
25
* @magentoDbIsolation enabled
26
26
* @magentoAppIsolation enabled
27
- * @magentoConfigFixture default_store catalog/review/allow_guest 1
27
+ * @magentoDataFixture Magento/Review/_files/config.php
28
28
* @magentoDataFixture Magento/Catalog/_files/products.php
29
29
*/
30
30
public function testAttemptForGuestToAddReviewsWithIncompleteData ()
@@ -50,7 +50,7 @@ public function testAttemptForGuestToAddReviewsWithIncompleteData()
50
50
*
51
51
* @magentoDbIsolation enabled
52
52
* @magentoAppIsolation enabled
53
- * @magentoConfigFixture default_store catalog/review/allow_guest 0
53
+ * @magentoDataFixture Magento/Review/_files/disable_config.php
54
54
* @magentoDataFixture Magento/Catalog/_files/products.php
55
55
*/
56
56
public function testAttemptForGuestToAddReview ()
@@ -71,6 +71,35 @@ public function testAttemptForGuestToAddReview()
71
71
$ this ->assertRedirect ($ this ->stringContains ('customer/account/login ' ));
72
72
}
73
73
74
+ /**
75
+ * Test successfully adding a product review by a guest
76
+ *
77
+ * @magentoDbIsolation enabled
78
+ * @magentoAppIsolation enabled
79
+ * @magentoDataFixture Magento/Review/_files/config.php
80
+ * @magentoDataFixture Magento/Catalog/_files/products.php
81
+ */
82
+ public function testSuccessfullyAddingProductReviewForGuest ()
83
+ {
84
+ $ product = $ this ->getProduct ();
85
+ /** @var FormKey $formKey */
86
+ $ formKey = $ this ->_objectManager ->get (FormKey::class);
87
+ $ post = [
88
+ 'nickname ' => 'Test nick ' ,
89
+ 'title ' => 'Summary ' ,
90
+ 'detail ' => 'Test Details ' ,
91
+ 'form_key ' => $ formKey ->getFormKey (),
92
+ ];
93
+
94
+ $ this ->prepareRequestData ($ post );
95
+ $ this ->dispatch ('review/product/post/id/ ' . $ product ->getId ());
96
+
97
+ $ this ->assertSessionMessages (
98
+ $ this ->equalTo (['You submitted your review for moderation. ' ]),
99
+ MessageInterface::TYPE_SUCCESS
100
+ );
101
+ }
102
+
74
103
/**
75
104
* @return ProductInterface
76
105
*/
0 commit comments