Skip to content

Commit 7d531df

Browse files
author
Stanislav Idolov
committed
MAGETWO-59130: [Github] REST API with searchCriteria does not return category_ids #6127
1 parent 42dbe3f commit 7d531df

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -713,16 +713,16 @@ public function testGetList()
713713

714714
$this->assertNotNull($response['items'][0]['sku']);
715715
$this->assertEquals('simple', $response['items'][0]['sku']);
716-
$isCategoryInformationExist = false;
716+
717717
$index = null;
718-
foreach($response['items'][0]['custom_attributes'] as $key => $customAttribute) {
718+
foreach ($response['items'][0]['custom_attributes'] as $key => $customAttribute) {
719719
if ($customAttribute['attribute_code'] == 'category_ids') {
720-
$isCategoryInformationExist = true;
721720
$index = $key;
721+
break;
722722
}
723723
}
724-
$this->assertTrue($isCategoryInformationExist, 'Category information wasn\'t set');
725-
$this->assertEquals([2], $response['items'][0]['custom_attributes'][$index]['value']);
724+
$this->assertNotNull($index, 'Category information wasn\'t set');
725+
$this->assertEquals(['2'], $response['items'][0]['custom_attributes'][$index]['value']);
726726
}
727727

728728
/**

0 commit comments

Comments
 (0)