88namespace Magento \Catalog \Model \Layer \Filter \DataProvider ;
99
1010use Magento \Catalog \Api \Data \CategoryInterfaceFactory ;
11- use Magento \Catalog \Model \Layer \Category as CategoryLayer ;
11+ use Magento \Catalog \Model \Layer \Resolver ;
1212use Magento \Framework \ObjectManagerInterface ;
1313use Magento \Framework \Registry ;
1414use Magento \TestFramework \Helper \Bootstrap ;
@@ -43,6 +43,9 @@ class CategoryTest extends TestCase
4343 */
4444 private $ registry ;
4545
46+ /** @var Resolver */
47+ private $ layerResolver ;
48+
4649 /**
4750 * @inheritdoc
4851 */
@@ -52,15 +55,15 @@ protected function setUp(): void
5255
5356 $ this ->objectManager = Bootstrap::getObjectManager ();
5457 $ this ->categoryFactory = $ this ->objectManager ->get (CategoryInterfaceFactory::class);
55- $ layer = $ this ->objectManager ->get (CategoryLayer ::class);
56- $ this ->provider = $ this ->objectManager ->create (Category::class, ['layer ' => $ layer ]);
58+ $ this -> layerResolver = $ this ->objectManager ->get (Resolver ::class);
59+ $ this ->provider = $ this ->objectManager ->create (Category::class, ['layer ' => $ this -> layerResolver -> get () ]);
5760 $ this ->registry = $ this ->objectManager ->get (Registry::class);
5861 }
5962
6063 /**
6164 * @return void
6265 */
63- public function testIsValidNotExistsCategory (): void
66+ public function testValidateCategoryWithoutId (): void
6467 {
6568 $ this ->registry ->register ('current_category ' , $ this ->categoryFactory ->create ());
6669 $ this ->provider ->setCategoryId (375211 );
@@ -72,7 +75,7 @@ public function testIsValidNotExistsCategory(): void
7275 *
7376 * @return void
7477 */
75- public function testIsValidNotActiveCategory (): void
78+ public function testValidateInactiveCategory (): void
7679 {
7780 $ this ->provider ->setCategoryId (111 );
7881 $ this ->assertFalse ($ this ->provider ->isValid ());
0 commit comments