55
66use IntegerNet \GlobalCustomLayout \Test \Util \CategoryLayoutUpdateManager ;
77use Magento \Catalog \Api \CategoryRepositoryInterface ;
8+ use Magento \Framework \Exception \CouldNotSaveException ;
9+ use Magento \Framework \Exception \NoSuchEntityException ;
810use Magento \TestFramework \Helper \Bootstrap ;
911
1012/**
@@ -17,8 +19,8 @@ class CategoryFrontendControllerTest extends AbstractFrontendControllerTest
1719 * Check that Global Custom Layout Update files work for Category views.
1820 *
1921 * @return void
20- * @throws \Magento\Framework\Exception\ CouldNotSaveException
21- * @throws \Magento\Framework\Exception\ NoSuchEntityException
22+ * @throws CouldNotSaveException
23+ * @throws NoSuchEntityException
2224 *
2325 * @magentoDataFixture Magento/CatalogUrlRewrite/_files/categories_with_product_ids.php
2426 */
@@ -29,11 +31,11 @@ public function testViewWithGlobalCustomUpdate(): void
2931 $ categoryId = 5 ;
3032
3133 /** @var CategoryLayoutUpdateManager $layoutManager */
32- $ layoutManager = Bootstrap:: getObjectManager () ->get (CategoryLayoutUpdateManager::class);
34+ $ layoutManager = $ this -> objectManager ->get (CategoryLayoutUpdateManager::class);
3335 $ layoutManager ->setCategoryFakeFiles (0 , [$ file ]);
3436
3537 /** @var CategoryRepositoryInterface $categoryRepo */
36- $ categoryRepo = Bootstrap:: getObjectManager () ->create (CategoryRepositoryInterface::class);
38+ $ categoryRepo = $ this -> objectManager ->create (CategoryRepositoryInterface::class);
3739 $ category = $ categoryRepo ->get ($ categoryId );
3840
3941 //Updating the custom attribute.
@@ -44,7 +46,7 @@ public function testViewWithGlobalCustomUpdate(): void
4446 $ this ->dispatch ("catalog/category/view/id/ $ categoryId " );
4547
4648 //Layout handles must contain the file.
47- $ handles = Bootstrap:: getObjectManager ()-> get (\ Magento \ Framework \ View \LayoutInterface::class)
49+ $ handles = $ this -> layoutInterface
4850 ->getUpdate ()
4951 ->getHandles ();
5052 $ this ->assertContains ("catalog_category_view_selectable_0_ {$ file }" , $ handles );
0 commit comments