From 966d8bb8c5d1bb368ad958063f0f25bf23d20dfc Mon Sep 17 00:00:00 2001 From: Bettina Date: Sat, 24 Mar 2018 13:28:04 -0300 Subject: [PATCH] fix OptionsRepository API test to add option by attribute_id --- .../ConfigurableProduct/Api/OptionRepositoryTest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php index 9c1caefd174e0..43d5a5b63b8a0 100644 --- a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php @@ -7,6 +7,9 @@ namespace Magento\ConfigurableProduct\Api; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Eav\Api\AttributeRepositoryInterface; + class OptionRepositoryTest extends \Magento\TestFramework\TestCase\WebapiAbstract { const SERVICE_NAME = 'configurableProductOptionRepositoryV1'; @@ -138,6 +141,12 @@ public function testDelete() */ public function testAdd() { + /** @var AttributeRepositoryInterface $attributeRepository */ + $attributeRepository = Bootstrap::getObjectManager()->create(AttributeRepositoryInterface::class); + + /** @var \Magento\Eav\Api\Data\AttributeInterface $attribute */ + $attribute = $attributeRepository->get('catalog_product', 'test_configurable'); + $productSku = 'simple'; $serviceInfo = [ 'rest' => [ @@ -151,7 +160,7 @@ public function testAdd() ] ]; $option = [ - 'attribute_id' => 'test_configurable', + 'attribute_id' => $attribute->getAttributeId(), 'label' => 'Test', 'values' => [ [