-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #251 from magento-goinc/pr-11.12
[SWAT] Bug fixes
- Loading branch information
Showing
13 changed files
with
170 additions
and
55 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
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
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
68 changes: 68 additions & 0 deletions
68
...s/app/Magento/Catalog/Test/Constraint/AssertProductTierPriceOnProductPageWithCustomer.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,68 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Catalog\Test\Constraint; | ||
|
||
use Magento\Catalog\Test\Page\Product\CatalogProductView; | ||
use Magento\Customer\Test\Fixture\Customer; | ||
use Magento\Mtf\Client\BrowserInterface; | ||
use Magento\Mtf\Constraint\AbstractConstraint; | ||
use Magento\Mtf\Fixture\FixtureInterface; | ||
|
||
/** | ||
* Assert that displayed tier price on product page equals passed from fixture for specified customer. | ||
*/ | ||
class AssertProductTierPriceOnProductPageWithCustomer extends AbstractConstraint | ||
{ | ||
/** | ||
* Assertion that tier prices are displayed correctly for specified customer | ||
* | ||
* @param BrowserInterface $browser | ||
* @param CatalogProductView $catalogProductView | ||
* @param FixtureInterface $product | ||
* @param Customer $customer | ||
* @return void | ||
*/ | ||
public function processAssert( | ||
BrowserInterface $browser, | ||
CatalogProductView $catalogProductView, | ||
FixtureInterface $product, | ||
Customer $customer | ||
) { | ||
$customer->persist(); | ||
$this->loginCustomer($customer); | ||
|
||
$productTierPriceAssert = $this->objectManager->get( | ||
'Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage' | ||
); | ||
$productTierPriceAssert->processAssert($browser, $catalogProductView, $product); | ||
} | ||
|
||
/** | ||
* Login customer | ||
* | ||
* @param Customer $customer | ||
* | ||
* @return void | ||
*/ | ||
protected function loginCustomer($customer) | ||
{ | ||
$this->objectManager->create( | ||
'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', | ||
['customer' => $customer] | ||
)->run(); | ||
} | ||
|
||
/** | ||
* Returns a string representation of the object | ||
* | ||
* @return string | ||
*/ | ||
public function toString() | ||
{ | ||
return 'Tier price is displayed on the product page for specific customer.'; | ||
} | ||
} |
Oops, something went wrong.