Skip to content

Commit 70138d7

Browse files
ACPT-1194
More fixes for failing graphql web api functional tests
1 parent 5a87d68 commit 70138d7

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Framework\DB\Query\Generator as QueryGenerator;
1414
use Magento\Framework\DB\Select;
1515
use Magento\Framework\EntityManager\MetadataPool;
16+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1617
use Magento\Store\Api\Data\StoreInterface;
1718
use Magento\Store\Model\Store;
1819

@@ -25,7 +26,7 @@
2526
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2627
* @since 100.0.2
2728
*/
28-
abstract class AbstractAction
29+
abstract class AbstractAction implements ResetAfterRequestInterface
2930
{
3031
/**
3132
* Chunk size
@@ -156,6 +157,20 @@ public function __construct(
156157
$this->tableMaintainer = $tableMaintainer ?: ObjectManager::getInstance()->get(TableMaintainer::class);
157158
}
158159

160+
/**
161+
* @inheritDoc
162+
*/
163+
public function _resetState(): void
164+
{
165+
$this->nonAnchorSelects = [];
166+
$this->anchorSelects = [];
167+
$this->productsSelects = [];
168+
$this->categoryPath = [];
169+
$this->useTempTable = true;
170+
$this->tempTreeIndexTableName = null;
171+
$this->currentStore = null;
172+
}
173+
159174
/**
160175
* Run full reindex
161176
*

dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/ProductInMultipleStoresCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency()
230230
$this->assertEquals(
231231
'EUR',
232232
$response['products']['items'][0]['price']['minimalPrice']['amount']['currency'],
233-
'Currency code EUR in fixture ' . $storeCodeFromFixture . ' is unexpected'
233+
'Currency code EUR in fixture ' . $storeCodeFromFixture . ' is expected'
234234
);
235235

236236
// test cached store + currency header in Euros

lib/internal/Magento/Framework/App/ResourceConnection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ResourceConnection implements ResetAfterRequestInterface
4040
*
4141
* @var array
4242
*/
43-
protected $mappedTableNames;
43+
protected $mappedTableNames = [];
4444

4545
/**
4646
* Resource config.
@@ -89,6 +89,7 @@ public function __construct(
8989
*/
9090
public function _resetState() : void
9191
{
92+
$this->mappedTableNames = [];
9293
foreach ($this->connections as $connection) {
9394
if ($connection instanceof ResetAfterRequestInterface) {
9495
$connection->_resetState();

0 commit comments

Comments
 (0)