forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - magento#19889: [Backport]Fix issue 19507 - Frontend Minicart dropdown alignment issue (by @speedy008) - magento#19910: [Backport] fixed Notification page Select Visible items issue (by @shikhamis11) - magento#19928: [Backport] [Review] Integration tests for not allowed review submission (by @eduard13) - magento#19056: Fix issue 19052- Position order showing before the text box (by @speedy008) - magento#19989: [Backport] Fixed magento#19605 Don't static compile disabled modules (by @shikhamis11) Fixed GitHub Issues: - magento#19507: Frontend Minicart dropdown alignment issue (reported by @speedy008) has been fixed in magento#19889 by @speedy008 in 2.2-develop branch Related commits: 1. afba6e4 - magento#19285: On Notification page Select All and Select Visible both works same (reported by @hellotaran) has been fixed in magento#19910 by @shikhamis11 in 2.2-develop branch Related commits: 1. 9804da7 2. c4bf9d2 3. 9e37895 4. b39a770 5. c0ea9e4 6. 0810a4a 7. a69b2d9 8. 598881f 9. 84461c5 10. 8397479 11. 3808266 12. 108b190 13. 25a6c2e 14. 4fd5c95 15. 2c55232 - magento#19052: Position order showing before the text box (reported by @Dharmeshvaja91) has been fixed in magento#19056 by @speedy008 in 2.2-develop branch Related commits: 1. 9e1459a - magento#19605: Don't static compile disabled modules (reported by @joshuaadickerson) has been fixed in magento#19989 by @shikhamis11 in 2.2-develop branch Related commits: 1. 1f5ec6f 2. 484b79a 3. d291cf3
- Loading branch information
Showing
6 changed files
with
199 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
...ests/integration/testsuite/Magento/Review/Controller/CaseCheckAddingProductReviewTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Review\Controller; | ||
|
||
use Magento\Catalog\Api\Data\ProductInterface; | ||
use Magento\Catalog\Api\ProductRepositoryInterface; | ||
use Magento\Framework\Data\Form\FormKey; | ||
use Magento\Framework\Message\MessageInterface; | ||
use Magento\TestFramework\Request; | ||
use Magento\TestFramework\TestCase\AbstractController; | ||
|
||
/** | ||
* Test review product controller behavior | ||
* | ||
* @magentoAppArea frontend | ||
*/ | ||
class CaseCheckAddingProductReviewTest extends AbstractController | ||
{ | ||
/** | ||
* Test adding a review for allowed guests with incomplete data by a not logged in user | ||
* | ||
* @magentoDbIsolation enabled | ||
* @magentoAppIsolation enabled | ||
* @magentoDataFixture Magento/Review/_files/config.php | ||
* @magentoDataFixture Magento/Catalog/_files/products.php | ||
*/ | ||
public function testAttemptForGuestToAddReviewsWithIncompleteData() | ||
{ | ||
$product = $this->getProduct(); | ||
/** @var FormKey $formKey */ | ||
$formKey = $this->_objectManager->get(FormKey::class); | ||
$post = [ | ||
'nickname' => 'Test nick', | ||
'title' => 'Summary', | ||
'form_key' => $formKey->getFormKey(), | ||
]; | ||
$this->prepareRequestData($post); | ||
$this->dispatch('review/product/post/id/' . $product->getId()); | ||
$this->assertSessionMessages( | ||
$this->equalTo(['Please enter a review.']), | ||
MessageInterface::TYPE_ERROR | ||
); | ||
} | ||
|
||
/** | ||
* Test adding a review for not allowed guests by a guest | ||
* | ||
* @magentoDbIsolation enabled | ||
* @magentoAppIsolation enabled | ||
* @magentoDataFixture Magento/Review/_files/disable_config.php | ||
* @magentoDataFixture Magento/Catalog/_files/products.php | ||
*/ | ||
public function testAttemptForGuestToAddReview() | ||
{ | ||
$product = $this->getProduct(); | ||
/** @var FormKey $formKey */ | ||
$formKey = $this->_objectManager->get(FormKey::class); | ||
$post = [ | ||
'nickname' => 'Test nick', | ||
'title' => 'Summary', | ||
'detail' => 'Test Details', | ||
'form_key' => $formKey->getFormKey(), | ||
]; | ||
|
||
$this->prepareRequestData($post); | ||
$this->dispatch('review/product/post/id/' . $product->getId()); | ||
|
||
$this->assertRedirect($this->stringContains('customer/account/login')); | ||
} | ||
|
||
/** | ||
* Test successfully adding a product review by a guest | ||
* | ||
* @magentoDbIsolation enabled | ||
* @magentoAppIsolation enabled | ||
* @magentoDataFixture Magento/Review/_files/config.php | ||
* @magentoDataFixture Magento/Catalog/_files/products.php | ||
*/ | ||
public function testSuccessfullyAddingProductReviewForGuest() | ||
{ | ||
$product = $this->getProduct(); | ||
/** @var FormKey $formKey */ | ||
$formKey = $this->_objectManager->get(FormKey::class); | ||
$post = [ | ||
'nickname' => 'Test nick', | ||
'title' => 'Summary', | ||
'detail' => 'Test Details', | ||
'form_key' => $formKey->getFormKey(), | ||
]; | ||
|
||
$this->prepareRequestData($post); | ||
$this->dispatch('review/product/post/id/' . $product->getId()); | ||
|
||
$this->assertSessionMessages( | ||
$this->equalTo(['You submitted your review for moderation.']), | ||
MessageInterface::TYPE_SUCCESS | ||
); | ||
} | ||
|
||
/** | ||
* @return ProductInterface | ||
*/ | ||
private function getProduct() | ||
{ | ||
return $this->_objectManager->get(ProductRepositoryInterface::class)->get('custom-design-simple-product'); | ||
} | ||
|
||
/** | ||
* @param array $postData | ||
* @return void | ||
*/ | ||
private function prepareRequestData($postData) | ||
{ | ||
$this->getRequest()->setMethod(Request::METHOD_POST); | ||
$this->getRequest()->setPostValue($postData); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
dev/tests/integration/testsuite/Magento/Review/_files/disable_config.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
/** @var Value $config */ | ||
use Magento\Framework\App\Config\Value; | ||
|
||
$config = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(Value::class); | ||
$config->setPath('catalog/review/allow_guest'); | ||
$config->setScope('default'); | ||
$config->setScopeId(0); | ||
$config->setValue(0); | ||
$config->save(); |