Skip to content

Commit 35cbc30

Browse files
committed
MAGETWO-54361: Configurable variation is displayed on category/product page when is out of stock
- Rename constraint;
1 parent dd0e86e commit 35cbc30

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* Assert that out of stock configurable option is not displayed on product page.
1616
*/
17-
class AssertOutOfStockOptionIsAbsentOnOnProductPage extends AbstractConstraint
17+
class AssertOutOfStockOptionIsAbsentOnProductPage extends AbstractConstraint
1818
{
1919
/**
2020
* Assert that out of stock configurable option is not displayed on product page on frontend.
@@ -37,18 +37,18 @@ public function processAssert(
3737
foreach ($listOptions as $option) {
3838
$productOptions = $catalogProductView->getConfigurableAttributesBlock()->getSelectOptionsData($option);
3939
}
40-
$option = $this->isOptionPresent($outOfStockOption, $productOptions);
40+
$option = $this->isOptionAbsent($outOfStockOption, $productOptions);
4141
\PHPUnit_Framework_Assert::assertTrue($option, 'Out of stock option is present on product page.');
4242
}
4343

4444
/**
45-
* Check if option is present on product page.
45+
* Check if option is absent on product page.
4646
*
4747
* @param string $needle
4848
* @param array $haystack
4949
* @return bool
5050
*/
51-
private function isOptionPresent($needle, array $haystack)
51+
private function isOptionAbsent($needle, array $haystack)
5252
{
5353
foreach ($haystack as $options) {
5454
foreach ($options as $option) {

dev/tests/functional/tests/app/Magento/CatalogInventoryConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<data name="product/data/description" xsi:type="string">Configurable Product description %isolation%</data>
2020
<data name="outOfStockOption" xsi:type="string">SIZE_S</data>
2121
<constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
22-
<constraint name="Magento\CatalogInventoryConfigurableProduct\Test\Constraint\AssertOutOfStockOptionIsAbsentOnOnProductPage" />
22+
<constraint name="Magento\CatalogInventoryConfigurableProduct\Test\Constraint\AssertOutOfStockOptionIsAbsentOnProductPage" />
2323
</variation>
2424
</testCase>
2525
</config>

dev/tests/functional/tests/app/Magento/CatalogInventoryConfigurableProduct/Test/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
9-
<type name="Magento\CatalogInventoryConfigurableProduct\Test\Constraint\AssertOutOfStockOptionIsAbsentOnOnProductPage">
9+
<type name="Magento\CatalogInventoryConfigurableProduct\Test\Constraint\AssertOutOfStockOptionIsAbsentOnProductPage">
1010
<arguments>
1111
<argument name="severity" xsi:type="string">middle</argument>
1212
</arguments>

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View/ConfigurableOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ConfigurableOptions extends CustomOptions
4646
*
4747
* @var string
4848
*/
49-
protected $configurableOptionElement = '#product-options-wrapper > * > .configurable';
49+
private $configurableOptionElement = '#product-options-wrapper > * > .configurable';
5050

5151
/**
5252
* Get configurable product options

0 commit comments

Comments
 (0)