-
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 #28768 from magento/storefront-2.4-merge
[17] Merge api-proto with develop #71
- Loading branch information
Showing
12 changed files
with
180 additions
and
13 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
53 changes: 53 additions & 0 deletions
53
...tegration/framework/Magento/TestFramework/Db/DymanicTables/CategoryProductIndexTables.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,53 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\TestFramework\Db\DymanicTables; | ||
|
||
use Magento\Framework\App\ResourceConnection; | ||
use Magento\Store\Model\Store; | ||
|
||
/** | ||
* Class to pre-create category product index tables | ||
*/ | ||
class CategoryProductIndexTables | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $prototype = 'catalog_category_product_index'; | ||
|
||
/** | ||
* @var ResourceConnection | ||
*/ | ||
private $resourceConnection; | ||
|
||
/** | ||
* @param ResourceConnection $resourceConnection | ||
*/ | ||
public function __construct( | ||
ResourceConnection $resourceConnection | ||
) { | ||
$this->resourceConnection = $resourceConnection; | ||
} | ||
|
||
/** | ||
* Creates category product index tables | ||
*/ | ||
public function createTables(): void | ||
{ | ||
$connection = $this->resourceConnection->getConnection(); | ||
for ($storeId = 0; $storeId <= 256; $storeId++) { | ||
$connection->createTable( | ||
$connection->createTableByDdl( | ||
$this->resourceConnection->getTableName($this->prototype), | ||
$this->resourceConnection->getTableName($this->prototype) . '_' . Store::ENTITY . $storeId | ||
) | ||
); | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
dev/tests/integration/framework/Magento/TestFramework/Db/DynamicTables.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,38 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\TestFramework\Db; | ||
|
||
use Magento\TestFramework\Db\DymanicTables\CategoryProductIndexTables; | ||
|
||
/** | ||
* Class to pre-create dynamic tables | ||
*/ | ||
class DynamicTables | ||
{ | ||
/** | ||
* @var CategoryProductIndexTables | ||
*/ | ||
private $categoryProductIndexTables; | ||
|
||
/** | ||
* @param CategoryProductIndexTables $categoryProductIndexTables | ||
*/ | ||
public function __construct( | ||
CategoryProductIndexTables $categoryProductIndexTables | ||
) { | ||
$this->categoryProductIndexTables = $categoryProductIndexTables; | ||
} | ||
|
||
/** | ||
* Create dynamic tables before the test to preserve integration tests isolation | ||
*/ | ||
public function createTables() | ||
{ | ||
$this->categoryProductIndexTables->createTables(); | ||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
dev/tests/integration/testsuite/Magento/Indexer/_files/reindex.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,9 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
$appDir = dirname(\Magento\TestFramework\Helper\Bootstrap::getInstance()->getAppTempDir()); | ||
// phpcs:ignore Magento2.Security.InsecureFunction | ||
exec("php -f {$appDir}/bin/magento indexer:reindex"); |
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