12
12
use Magento \Authorization \Model \RulesFactory ;
13
13
use Magento \Catalog \Api \Data \CategoryInterface ;
14
14
use Magento \Catalog \Model \Attribute \ScopeOverriddenValue ;
15
+ use Magento \Catalog \Model \Category ;
15
16
use Magento \CatalogUrlRewrite \Model \CategoryUrlRewriteGenerator ;
16
17
use Magento \Integration \Api \AdminTokenServiceInterface ;
17
18
use Magento \Store \Model \Store ;
@@ -193,7 +194,7 @@ public function testDeleteSystemOrRoot()
193
194
public function deleteSystemOrRootDataProvider ()
194
195
{
195
196
return [
196
- [\ Magento \ Catalog \ Model \ Category::TREE_ROOT_ID ],
197
+ [Category::TREE_ROOT_ID ],
197
198
[2 ] //Default root category
198
199
];
199
200
}
@@ -216,8 +217,8 @@ public function testUpdate()
216
217
];
217
218
$ result = $ this ->updateCategory ($ categoryId , $ categoryData );
218
219
$ this ->assertEquals ($ categoryId , $ result ['id ' ]);
219
- /** @var \Magento\Catalog\Model\ Category $model */
220
- $ model = Bootstrap::getObjectManager ()->get (\ Magento \ Catalog \ Model \ Category::class);
220
+ /** @var Category $model */
221
+ $ model = Bootstrap::getObjectManager ()->get (Category::class);
221
222
$ category = $ model ->load ($ categoryId );
222
223
$ this ->assertFalse ((bool )$ category ->getIsActive (), 'Category "is_active" must equal to false ' );
223
224
$ this ->assertEquals ("Update Category Test " , $ category ->getName ());
@@ -244,8 +245,8 @@ public function testUpdateWithDefaultSortByAttribute()
244
245
];
245
246
$ result = $ this ->updateCategory ($ categoryId , $ categoryData );
246
247
$ this ->assertEquals ($ categoryId , $ result ['id ' ]);
247
- /** @var \Magento\Catalog\Model\ Category $model */
248
- $ model = Bootstrap::getObjectManager ()->get (\ Magento \ Catalog \ Model \ Category::class);
248
+ /** @var Category $model */
249
+ $ model = Bootstrap::getObjectManager ()->get (Category::class);
249
250
$ category = $ model ->load ($ categoryId );
250
251
$ this ->assertTrue ((bool )$ category ->getIsActive (), 'Category "is_active" must equal to true ' );
251
252
$ this ->assertEquals ("Update Category Test With default_sort_by Attribute " , $ category ->getName ());
@@ -288,8 +289,8 @@ public function testUpdateUrlKey()
288
289
];
289
290
$ result = $ this ->updateCategory ($ categoryId , $ categoryData );
290
291
$ this ->assertEquals ($ categoryId , $ result ['id ' ]);
291
- /** @var \Magento\Catalog\Model\ Category $model */
292
- $ model = Bootstrap::getObjectManager ()->get (\ Magento \ Catalog \ Model \ Category::class);
292
+ /** @var Category $model */
293
+ $ model = Bootstrap::getObjectManager ()->get (Category::class);
293
294
$ category = $ model ->load ($ categoryId );
294
295
$ this ->assertEquals ("Update Category Test New Name " , $ category ->getName ());
295
296
@@ -564,7 +565,6 @@ public function testSaveDesign(): void
564
565
/**
565
566
* Check if repository does not override default values for attributes out of request
566
567
*
567
- * @throws \Exception
568
568
* @magentoApiDataFixture Magento/Catalog/_files/category.php
569
569
*/
570
570
public function testUpdateScopeAttribute ()
@@ -576,8 +576,8 @@ public function testUpdateScopeAttribute()
576
576
$ result = $ this ->updateCategoryForSpecificStore ($ categoryId , $ categoryData );
577
577
$ this ->assertEquals ($ categoryId , $ result ['id ' ]);
578
578
579
- /** @var \Magento\Catalog\Model\ Category $model */
580
- $ model = Bootstrap::getObjectManager ()->get (\ Magento \ Catalog \ Model \ Category::class);
579
+ /** @var Category $model */
580
+ $ model = Bootstrap::getObjectManager ()->get (Category::class);
581
581
$ category = $ model ->load ($ categoryId );
582
582
583
583
/** @var ScopeOverriddenValue $scopeOverriddenValue */
0 commit comments