Skip to content

Commit b6206fe

Browse files
author
Oleksandr Iegorov
committed
MC-29755: X-Magento-Tags header too large
1 parent 219024d commit b6206fe

File tree

2 files changed

+38
-58
lines changed

2 files changed

+38
-58
lines changed

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtenderTest.php

Lines changed: 0 additions & 56 deletions
This file was deleted.

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

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,43 @@ public function testGetIdentities()
2222
$simple10Product = $productRepository->get('simple_10');
2323
$simple20Product = $productRepository->get('simple_20');
2424

25-
$this->assertEmpty(array_diff($confProduct->getIdentities(), $simple10Product->getIdentities()));
26-
$this->assertEmpty(array_diff($confProduct->getIdentities(), $simple20Product->getIdentities()));
25+
$this->assertNotEmpty(array_diff($confProduct->getIdentities(), $simple10Product->getIdentities()));
26+
$this->assertNotEmpty(array_diff($confProduct->getIdentities(), $simple20Product->getIdentities()));
27+
}
28+
29+
/**
30+
* Check that no children identities are added to the parent product in frontend area
31+
*
32+
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
33+
* @magentoAppArea frontend
34+
* @return void
35+
*/
36+
public function testGetIdentitiesForConfigurableProductOnStorefront(): void
37+
{
38+
$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
39+
$configurableProduct = $productRepository->get('configurable');
40+
$expectedIdentities = [
41+
'cat_p_' . $configurableProduct->getId(),
42+
'cat_p'
43+
44+
];
45+
$this->assertEquals($expectedIdentities, $configurableProduct->getIdentities());
46+
}
47+
48+
/**
49+
* Check that no children identities are added to the parent product in frontend area
50+
*
51+
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
52+
* @magentoAppArea adminhtml
53+
* @return void
54+
*/
55+
public function testGetIdentitiesForConfigurableProductInAdminArea(): void
56+
{
57+
$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
58+
$configurableProduct = $productRepository->get('configurable');
59+
$expectedIdentities = [
60+
'cat_p_' . $configurableProduct->getId(),
61+
];
62+
$this->assertEquals($expectedIdentities, $configurableProduct->getIdentities());
2763
}
2864
}

0 commit comments

Comments
 (0)