Skip to content

Commit 053e746

Browse files
committed
MAGETWO-94086: [Forwardport] Run Catalog Search reindex in multithread mode with AdvancedSearch
1 parent 892ada0 commit 053e746

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/product_rewrite_multistore_rollback.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,30 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
use Magento\TestFramework\Helper\Bootstrap;
7+
declare(strict_types=1);
88

9-
$objectManager = Bootstrap::getObjectManager();
9+
use Magento\Framework\Exception\NoSuchEntityException;
10+
11+
\Magento\TestFramework\Helper\Bootstrap::getInstance()->getInstance()->reinitialize();
12+
13+
/** @var \Magento\Framework\Registry $registry */
14+
$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class);
15+
16+
$registry->unregister('isSecureArea');
17+
$registry->register('isSecureArea', true);
18+
19+
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
20+
$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
21+
->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
22+
try {
23+
$product = $productRepository->get('product1', true);
24+
if ($product->getId()) {
25+
$productRepository->delete($product);
26+
}
27+
} catch (NoSuchEntityException $e) {
28+
}
29+
$registry->unregister('isSecureArea');
30+
$registry->register('isSecureArea', false);
1031

1132
require __DIR__ . '/../../Store/_files/store_rollback.php';
1233
require __DIR__ . '/../../Store/_files/second_store_rollback.php';

0 commit comments

Comments
 (0)