1515use Magento \Framework \Message \MessageInterface ;
1616use Magento \Framework \Serialize \Serializer \Json ;
1717use Magento \Store \Api \StoreRepositoryInterface ;
18- use Magento \TestFramework \TestCase \AbstractBackendController ;
1918use 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