8
8
namespace Magento \Catalog \Model \Layer \Filter \DataProvider ;
9
9
10
10
use Magento \Catalog \Api \Data \CategoryInterfaceFactory ;
11
- use Magento \Catalog \Model \Layer \Category as CategoryLayer ;
11
+ use Magento \Catalog \Model \Layer \Resolver ;
12
12
use Magento \Framework \ObjectManagerInterface ;
13
13
use Magento \Framework \Registry ;
14
14
use Magento \TestFramework \Helper \Bootstrap ;
@@ -43,6 +43,9 @@ class CategoryTest extends TestCase
43
43
*/
44
44
private $ registry ;
45
45
46
+ /** @var Resolver */
47
+ private $ layerResolver ;
48
+
46
49
/**
47
50
* @inheritdoc
48
51
*/
@@ -52,15 +55,15 @@ protected function setUp(): void
52
55
53
56
$ this ->objectManager = Bootstrap::getObjectManager ();
54
57
$ 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 () ]);
57
60
$ this ->registry = $ this ->objectManager ->get (Registry::class);
58
61
}
59
62
60
63
/**
61
64
* @return void
62
65
*/
63
- public function testIsValidNotExistsCategory (): void
66
+ public function testValidateCategoryWithoutId (): void
64
67
{
65
68
$ this ->registry ->register ('current_category ' , $ this ->categoryFactory ->create ());
66
69
$ this ->provider ->setCategoryId (375211 );
@@ -72,7 +75,7 @@ public function testIsValidNotExistsCategory(): void
72
75
*
73
76
* @return void
74
77
*/
75
- public function testIsValidNotActiveCategory (): void
78
+ public function testValidateInactiveCategory (): void
76
79
{
77
80
$ this ->provider ->setCategoryId (111 );
78
81
$ this ->assertFalse ($ this ->provider ->isValid ());
0 commit comments