5
5
6
6
use IntegerNet \GlobalCustomLayout \Test \Util \CategoryLayoutUpdateManager ;
7
7
use Magento \Catalog \Api \CategoryRepositoryInterface ;
8
+ use Magento \Framework \Exception \CouldNotSaveException ;
9
+ use Magento \Framework \Exception \NoSuchEntityException ;
8
10
use Magento \TestFramework \Helper \Bootstrap ;
9
11
10
12
/**
@@ -17,8 +19,8 @@ class CategoryFrontendControllerTest extends AbstractFrontendControllerTest
17
19
* Check that Global Custom Layout Update files work for Category views.
18
20
*
19
21
* @return void
20
- * @throws \Magento\Framework\Exception\ CouldNotSaveException
21
- * @throws \Magento\Framework\Exception\ NoSuchEntityException
22
+ * @throws CouldNotSaveException
23
+ * @throws NoSuchEntityException
22
24
*
23
25
* @magentoDataFixture Magento/CatalogUrlRewrite/_files/categories_with_product_ids.php
24
26
*/
@@ -29,11 +31,11 @@ public function testViewWithGlobalCustomUpdate(): void
29
31
$ categoryId = 5 ;
30
32
31
33
/** @var CategoryLayoutUpdateManager $layoutManager */
32
- $ layoutManager = Bootstrap:: getObjectManager () ->get (CategoryLayoutUpdateManager::class);
34
+ $ layoutManager = $ this -> objectManager ->get (CategoryLayoutUpdateManager::class);
33
35
$ layoutManager ->setCategoryFakeFiles (0 , [$ file ]);
34
36
35
37
/** @var CategoryRepositoryInterface $categoryRepo */
36
- $ categoryRepo = Bootstrap:: getObjectManager () ->create (CategoryRepositoryInterface::class);
38
+ $ categoryRepo = $ this -> objectManager ->create (CategoryRepositoryInterface::class);
37
39
$ category = $ categoryRepo ->get ($ categoryId );
38
40
39
41
//Updating the custom attribute.
@@ -44,7 +46,7 @@ public function testViewWithGlobalCustomUpdate(): void
44
46
$ this ->dispatch ("catalog/category/view/id/ $ categoryId " );
45
47
46
48
//Layout handles must contain the file.
47
- $ handles = Bootstrap:: getObjectManager ()-> get (\ Magento \ Framework \ View \LayoutInterface::class)
49
+ $ handles = $ this -> layoutInterface
48
50
->getUpdate ()
49
51
->getHandles ();
50
52
$ this ->assertContains ("catalog_category_view_selectable_0_ {$ file }" , $ handles );
0 commit comments