Skip to content

Commit 9faeb82

Browse files
committed
Deliver catalog storefront tests changes to mainline
1 parent 46f6188 commit 9faeb82

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_with_frontend_label_attribute.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,27 @@
55
*/
66
declare(strict_types=1);
77

8+
use Magento\Catalog\Model\Product;
89
use Magento\Eav\Api\AttributeRepositoryInterface;
10+
use Magento\Eav\Model\Config;
911
use Magento\Eav\Model\Entity\Attribute\FrontendLabel;
1012
use Magento\TestFramework\Helper\Bootstrap;
13+
use Magento\TestFramework\Workaround\Override\Fixture\Resolver;
1114

12-
require __DIR__ . '/configurable_products.php';
15+
Resolver::getInstance()->requireDataFixture('Magento/ConfigurableProduct/_files/configurable_products.php');
1316

17+
$objectManager = Bootstrap::getObjectManager();
18+
/** @var AttributeRepositoryInterface $attributeRepository */
19+
$attributeRepository = $objectManager->create(AttributeRepositoryInterface::class);
1420
// Add frontend label to created attribute:
15-
$frontendLabelAttribute = Bootstrap::getObjectManager()->get(FrontendLabel::class);
21+
$frontendLabelAttribute = $objectManager->get(FrontendLabel::class);
1622
$frontendLabelAttribute->setStoreId(1);
1723
$frontendLabelAttribute->setLabel('Default Store View label');
18-
24+
/** @var Config $eavConfig */
25+
$eavConfig = $objectManager->get(Config::class);
26+
$attribute = $eavConfig->getAttribute(Product::ENTITY, 'test_configurable');
1927
$frontendLabels = $attribute->getFrontendLabels();
2028
$frontendLabels[] = $frontendLabelAttribute;
2129

2230
$attribute->setFrontendLabels($frontendLabels);
23-
$attributeRepository = Bootstrap::getObjectManager()->create(AttributeRepositoryInterface::class);
2431
$attributeRepository->save($attribute);

0 commit comments

Comments
 (0)