Skip to content

Commit 8231818

Browse files
committed
ACP2E-3063: [Cloud] Cache is not getting invalidated.
- with test
1 parent 17f1f83 commit 8231818

File tree

2 files changed

+30
-17
lines changed

2 files changed

+30
-17
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,11 @@ protected function _copyFileToBaseTmpMediaPath($sourceFile)
260260

261261
$mediaDirectory->create($config->getBaseTmpMediaPath());
262262
$targetFile = $config->getTmpMediaPath(basename($sourceFile));
263-
$mediaDirectory->getDriver()->filePutContents($mediaDirectory->getAbsolutePath($targetFile), file_get_contents($sourceFile));
263+
$mediaDirectory->getDriver()
264+
->filePutContents(
265+
$mediaDirectory->getAbsolutePath($targetFile),
266+
file_get_contents($sourceFile)
267+
);
264268

265269
return $targetFile;
266270
}
@@ -298,36 +302,43 @@ public function testDuplicate()
298302

299303
try {
300304
$this->assertNotEquals(
301-
$customScopeDuplicate->getId(), $customScopeProduct->getId(),
305+
$customScopeDuplicate->getId(),
306+
$customScopeProduct->getId(),
302307
'Duplicate product Id should not equal to source product Id'
303308
);
304309
$this->assertNotEquals(
305-
$customScopeDuplicate->getSku(), $customScopeProduct->getSku(),
310+
$customScopeDuplicate->getSku(),
311+
$customScopeProduct->getSku(),
306312
'Duplicate product SKU should not equal to source product SKU'
307313
);
308314
$this->assertNotEquals(
309-
$customScopeDuplicate->getShortDescription(), $defaultScopeDuplicate->getShortDescription(),
315+
$customScopeDuplicate->getShortDescription(),
316+
$defaultScopeDuplicate->getShortDescription(),
310317
'Short description of the duplicated product on custom scope should not equal to ' .
311318
'duplicate product description on default scope'
312319
);
313320
$this->assertEquals(
314-
$customScopeProduct->getShortDescription(), $customScopeDuplicate->getShortDescription(),
321+
$customScopeProduct->getShortDescription(),
322+
$customScopeDuplicate->getShortDescription(),
315323
'Short description of the duplicated product on custom scope should equal to ' .
316324
'source product description on custom scope'
317325
);
318326
$this->assertEquals(
319-
$customScopeProduct->getStoreId(), $customScopeDuplicate->getStoreId(),
327+
$customScopeProduct->getStoreId(),
328+
$customScopeDuplicate->getStoreId(),
320329
'Store Id of the duplicated product on custom scope should equal to ' .
321330
'store Id of source product on custom scope'
322331
);
323332
$this->assertEquals(
324-
$defaultScopeProduct->getStoreId(), $defaultScopeDuplicate->getStoreId(),
333+
$defaultScopeProduct->getStoreId(),
334+
$defaultScopeDuplicate->getStoreId(),
325335
'Store Id of the duplicated product on default scope should equal to ' .
326336
'store Id of source product on default scope'
327337
);
328338

329339
$this->assertEquals(
330-
Status::STATUS_DISABLED, $defaultScopeDuplicate->getStatus(),
340+
Status::STATUS_DISABLED,
341+
$defaultScopeDuplicate->getStatus(),
331342
'Duplicate should be disabled'
332343
);
333344

@@ -886,8 +897,10 @@ public function testSetPriceWithoutTypeId()
886897
* Tests case for product saving invalidate cache successfully
887898
*/
888899
#[
889-
DataFixture(ProductFixture::class,
890-
['sku' => 'simple1', 'price' => 10, 'page_layout' => '1column'], as: 'product'
900+
DataFixture(
901+
ProductFixture::class,
902+
['sku' => 'simple1', 'price' => 10, 'page_layout' => '1column'],
903+
as: 'product'
891904
),
892905
]
893906
public function testSavingProductInAdminWithLayoutChangeWillInvalidateCache()
@@ -900,9 +913,9 @@ public function testSavingProductInAdminWithLayoutChangeWillInvalidateCache()
900913
Block::class
901914
);
902915
$cacheKey = sprintf(
903-
'%s',
904-
str_replace('{{ID}}', (string) $product->getId(), Instance::SINGLE_PRODUCT_LAYOUT_HANDLE)
905-
);
916+
'%s',
917+
str_replace('{{ID}}', (string)$product->getId(), Instance::SINGLE_PRODUCT_LAYOUT_HANDLE)
918+
);
906919

907920
$product->setPageLayout('cms-full-width');
908921
$this->productRepository->save($product);

dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ public function testPageWithChangedLayoutCanCleanCacheTag(): void
168168
);
169169
$page = $this->pageRetriever->execute($pageIdentifier, 0);
170170
$cacheKey = sprintf(
171-
'%s_%s',
172-
'CMS_PAGE_VIEW_ID',
173-
str_replace('-', '_', strtoupper($page->getId()))
174-
);
171+
'%s_%s',
172+
'CMS_PAGE_VIEW_ID',
173+
str_replace('-', '_', strtoupper($page->getId()))
174+
);
175175

176176
$this->dispatch('/cms/page/view/page_id/' . $page->getId());
177177
$this->assertStringContainsString(

0 commit comments

Comments
 (0)