Skip to content

Commit 451202c

Browse files
author
Stanislav Idolov
committed
ENGCOM-2981: #18009: Cannot create a numeric value attribute option using the REST API. #2158
1 parent 461f6de commit 451202c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/OptionManagementTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ public function testAdd()
5858
$labelMock = $this->createMock(\Magento\Eav\Api\Data\AttributeOptionLabelInterface::class);
5959
$option =
6060
['value' => [
61-
'new_option' => [
61+
'id_new_option' => [
6262
0 => 'optionLabel',
6363
42 => 'labelLabel',
6464
],
6565
],
6666
'order' => [
67-
'new_option' => 'optionSortOrder',
67+
'id_new_option' => 'optionSortOrder',
6868
],
6969
];
7070

@@ -77,7 +77,7 @@ public function testAdd()
7777
$labelMock->expects($this->once())->method('getStoreId')->willReturn(42);
7878
$labelMock->expects($this->once())->method('getLabel')->willReturn('labelLabel');
7979
$optionMock->expects($this->once())->method('getIsDefault')->willReturn(true);
80-
$attributeMock->expects($this->once())->method('setDefault')->with(['new_option']);
80+
$attributeMock->expects($this->once())->method('setDefault')->with(['id_new_option']);
8181
$attributeMock->expects($this->once())->method('setOption')->with($option);
8282
$this->resourceModelMock->expects($this->once())->method('save')->with($attributeMock);
8383
$this->assertTrue($this->model->add($entityType, $attributeCode, $optionMock));
@@ -166,13 +166,13 @@ public function testAddWithCannotSaveException()
166166
$labelMock = $this->createMock(\Magento\Eav\Api\Data\AttributeOptionLabelInterface::class);
167167
$option =
168168
['value' => [
169-
'new_option' => [
169+
'id_new_option' => [
170170
0 => 'optionLabel',
171171
42 => 'labelLabel',
172172
],
173173
],
174174
'order' => [
175-
'new_option' => 'optionSortOrder',
175+
'id_new_option' => 'optionSortOrder',
176176
],
177177
];
178178

@@ -185,7 +185,7 @@ public function testAddWithCannotSaveException()
185185
$labelMock->expects($this->once())->method('getStoreId')->willReturn(42);
186186
$labelMock->expects($this->once())->method('getLabel')->willReturn('labelLabel');
187187
$optionMock->expects($this->once())->method('getIsDefault')->willReturn(true);
188-
$attributeMock->expects($this->once())->method('setDefault')->with(['new_option']);
188+
$attributeMock->expects($this->once())->method('setDefault')->with(['id_new_option']);
189189
$attributeMock->expects($this->once())->method('setOption')->with($option);
190190
$this->resourceModelMock->expects($this->once())->method('save')->with($attributeMock)
191191
->willThrowException(new \Exception());

0 commit comments

Comments
 (0)