Skip to content

Commit 800ae03

Browse files
authored
Merge pull request #2389 from magento-tango/MAGETWO-81901
Fixed issues: - MAGETWO-81901: Move statuses constants from class to the interface
2 parents 8389f7a + 2cafb7a commit 800ae03

File tree

6 files changed

+24
-20
lines changed

6 files changed

+24
-20
lines changed

app/code/Magento/CatalogInventory/Api/Data/StockStatusInterface.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
*/
1515
interface StockStatusInterface extends ExtensibleDataInterface
1616
{
17+
/**#@+
18+
* Stock Status values
19+
*/
20+
const STATUS_OUT_OF_STOCK = 0;
21+
22+
const STATUS_IN_STOCK = 1;
23+
/**#@-*/
24+
1725
/**#@+
1826
* Stock status object data keys
1927
*/

app/code/Magento/CatalogInventory/Model/Stock/Status.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@
1717
*/
1818
class Status extends AbstractExtensibleModel implements StockStatusInterface
1919
{
20-
/**#@+
21-
* Stock Status values
22-
*/
23-
const STATUS_OUT_OF_STOCK = 0;
24-
25-
const STATUS_IN_STOCK = 1;
26-
/**#@-*/
27-
2820
/**#@+
2921
* Field name
3022
*/

dev/tests/integration/testsuite/Magento/Framework/Search/Adapter/Mysql/AdapterTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ protected function setUp()
6464
);
6565

6666
$this->adapter = $this->createAdapter();
67+
68+
$indexer = $this->objectManager->create(\Magento\Indexer\Model\Indexer::class);
69+
$indexer->load('catalogsearch_fulltext');
70+
$indexer->reindexAll();
6771
}
6872

6973
/**
@@ -533,9 +537,15 @@ public function testAdvancedSearchCompositeProductWithOutOfStockOption()
533537
->create(Collection::class)
534538
->setAttributeFilter($attribute->getId());
535539

540+
$visibility = [
541+
\Magento\Catalog\Model\Product\Visibility::VISIBILITY_IN_SEARCH,
542+
\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH,
543+
];
544+
536545
$firstOption = $selectOptions->getFirstItem();
537546
$firstOptionId = $firstOption->getId();
538547
$this->requestBuilder->bind('test_configurable', $firstOptionId);
548+
$this->requestBuilder->bind('visibility', $visibility);
539549
$this->requestBuilder->setRequestName('filter_out_of_stock_child');
540550

541551
$queryResponse = $this->executeQuery();
@@ -544,6 +554,7 @@ public function testAdvancedSearchCompositeProductWithOutOfStockOption()
544554
$secondOption = $selectOptions->getLastItem();
545555
$secondOptionId = $secondOption->getId();
546556
$this->requestBuilder->bind('test_configurable', $secondOptionId);
557+
$this->requestBuilder->bind('visibility', $visibility);
547558
$this->requestBuilder->setRequestName('filter_out_of_stock_child');
548559

549560
$queryResponse = $this->executeQuery();

dev/tests/integration/testsuite/Magento/Framework/Search/_files/product_configurable.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
use Magento\Eav\Api\Data\AttributeOptionInterface;
1616
use Magento\TestFramework\Helper\Bootstrap;
1717

18-
Bootstrap::getInstance()->reinitialize();
19-
2018
require __DIR__ . '/configurable_attribute.php';
2119

2220
/** @var ProductRepositoryInterface $productRepository */

dev/tests/integration/testsuite/Magento/Framework/Search/_files/requests.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,18 @@
394394
<queries>
395395
<query xsi:type="boolQuery" name="filter_out_of_stock_child" boost="1">
396396
<queryReference clause="must" ref="test_configurable"/>
397+
<queryReference clause="must" ref="visibility"/>
397398
</query>
398399
<query xsi:type="filteredQuery" name="test_configurable">
399400
<filterReference clause="must" ref="test_configurable_filter"/>
400401
</query>
402+
<query xsi:type="filteredQuery" name="visibility">
403+
<filterReference clause="must" ref="visibility_filter"/>
404+
</query>
401405
</queries>
402406
<filters>
403407
<filter xsi:type="termFilter" name="test_configurable_filter" field="test_configurable" value="$test_configurable$"/>
408+
<filter xsi:type="termFilter" name="visibility_filter" field="visibility" value="$visibility$"/>
404409
</filters>
405410
<aggregations/>
406411
<from>0</from>

dev/tests/integration/testsuite/Magento/Framework/Search/_files/search_weight_products.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,8 @@
77
*/
88

99
use Magento\Catalog\Api\ProductRepositoryInterface;
10-
use Magento\Catalog\Model\Product;
11-
use Magento\Catalog\Model\Product\Attribute\Source\Status;
12-
use Magento\Catalog\Model\Product\Type;
13-
use Magento\Catalog\Model\Product\Visibility;
14-
use Magento\Catalog\Setup\CategorySetup;
15-
use Magento\ConfigurableProduct\Helper\Product\Options\Factory;
16-
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
17-
use Magento\Eav\Api\Data\AttributeOptionInterface;
1810
use Magento\TestFramework\Helper\Bootstrap;
1911

20-
Bootstrap::getInstance()->reinitialize();
21-
2212
$objectManager = Bootstrap::getObjectManager();
2313

2414
/** @var ProductRepositoryInterface $productRepository */

0 commit comments

Comments
 (0)