Skip to content

Commit 966d8bb

Browse files
committed
fix OptionsRepository API test to add option by attribute_id
1 parent 068a97e commit 966d8bb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace Magento\ConfigurableProduct\Api;
99

10+
use Magento\TestFramework\Helper\Bootstrap;
11+
use Magento\Eav\Api\AttributeRepositoryInterface;
12+
1013
class OptionRepositoryTest extends \Magento\TestFramework\TestCase\WebapiAbstract
1114
{
1215
const SERVICE_NAME = 'configurableProductOptionRepositoryV1';
@@ -138,6 +141,12 @@ public function testDelete()
138141
*/
139142
public function testAdd()
140143
{
144+
/** @var AttributeRepositoryInterface $attributeRepository */
145+
$attributeRepository = Bootstrap::getObjectManager()->create(AttributeRepositoryInterface::class);
146+
147+
/** @var \Magento\Eav\Api\Data\AttributeInterface $attribute */
148+
$attribute = $attributeRepository->get('catalog_product', 'test_configurable');
149+
141150
$productSku = 'simple';
142151
$serviceInfo = [
143152
'rest' => [
@@ -151,7 +160,7 @@ public function testAdd()
151160
]
152161
];
153162
$option = [
154-
'attribute_id' => 'test_configurable',
163+
'attribute_id' => $attribute->getAttributeId(),
155164
'label' => 'Test',
156165
'values' => [
157166
[

0 commit comments

Comments
 (0)