Skip to content

Commit 3061b40

Browse files
committed
ACP2E-2857: update webapi test to test default_sort_by
1 parent a3912ba commit 3061b40

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,20 +269,21 @@ public function testUpdate()
269269
$this->createdCategories = [$categoryId];
270270
}
271271

272-
/**
273-
* @magentoApiDataFixture Magento/Catalog/_files/category.php
274-
*/
272+
#[
273+
DataFixture(CategoryFixture::class, as: 'category')
274+
]
275275
public function testUpdateWithDefaultSortByAttribute()
276276
{
277-
$categoryId = 333;
277+
$category = $this->fixtures->get('category');
278+
$categoryId = $category->getId();
278279
$categoryData = [
279280
'name' => 'Update Category Test With default_sort_by Attribute',
280281
'is_active' => true,
281282
"available_sort_by" => [],
282283
'custom_attributes' => [
283284
[
284285
'attribute_code' => 'default_sort_by',
285-
'value' => ["name"],
286+
'value' => "price"
286287
],
287288
],
288289
];
@@ -293,7 +294,7 @@ public function testUpdateWithDefaultSortByAttribute()
293294
$category = $model->load($categoryId);
294295
$this->assertTrue((bool)$category->getIsActive(), 'Category "is_active" must equal to true');
295296
$this->assertEquals("Update Category Test With default_sort_by Attribute", $category->getName());
296-
$this->assertEquals("name", $category->getDefaultSortBy());
297+
$this->assertEquals("price", $category->getDefaultSortBy());
297298
$this->createdCategories = [$categoryId];
298299
}
299300

0 commit comments

Comments
 (0)