Skip to content

Commit 897b2de

Browse files
committed
Fix failed integration test
1 parent 59c98b7 commit 897b2de

File tree

1 file changed

+11
-7
lines changed
  • dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml

1 file changed

+11
-7
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/CategoryTest.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
use Magento\Framework\Message\MessageInterface;
1616
use Magento\Framework\Serialize\Serializer\Json;
1717
use Magento\Store\Api\StoreRepositoryInterface;
18-
use Magento\TestFramework\TestCase\AbstractBackendController;
1918
use Magento\TestFramework\Helper\Bootstrap;
19+
use Magento\TestFramework\TestCase\AbstractBackendController;
2020

2121
/**
2222
* Test for category backend actions
@@ -63,6 +63,7 @@ protected function setUp()
6363
* @param array $defaultAttributes
6464
* @param array $attributesSaved
6565
* @return void
66+
* @throws \Magento\Framework\Exception\NoSuchEntityException
6667
*/
6768
public function testSaveAction(array $inputData, array $defaultAttributes, array $attributesSaved = []): void
6869
{
@@ -107,6 +108,8 @@ public function testSaveAction(array $inputData, array $defaultAttributes, array
107108
* @magentoDbIsolation enabled
108109
* @magentoDataFixture Magento/CatalogUrlRewrite/_files/categories.php
109110
* @return void
111+
* @throws \Magento\Framework\Exception\CouldNotSaveException
112+
* @throws \Magento\Framework\Exception\NoSuchEntityException
110113
*/
111114
public function testDefaultValueForCategoryUrlPath(): void
112115
{
@@ -125,19 +128,20 @@ public function testDefaultValueForCategoryUrlPath(): void
125128
// set default url_path and check it
126129
$this->getRequest()->setMethod(HttpRequest::METHOD_POST);
127130
$postData = $category->getData();
128-
$postData['use_default'] = [
129-
'available_sort_by' => 1,
130-
'default_sort_by' => 1,
131-
'url_key' => 1,
132-
];
131+
$postData['use_default'] =
132+
[
133+
'available_sort_by' => 1,
134+
'default_sort_by' => 1,
135+
'url_key' => 1,
136+
];
133137
$this->getRequest()->setPostValue($postData);
134138
$this->dispatch('backend/catalog/category/save');
135139
$this->assertSessionMessages(
136140
$this->equalTo([(string)__('You saved the category.')]),
137141
MessageInterface::TYPE_SUCCESS
138142
);
139143
$category = $this->categoryRepository->get($categoryId);
140-
$this->assertEquals($defaultUrlPath, $category->getData('url_path'));
144+
$this->assertEquals($defaultUrlPath, $category->getData('url_key'));
141145
}
142146

143147
/**

0 commit comments

Comments
 (0)