88use Magento \Eav \Model \Entity \Attribute \Frontend \DefaultFrontend ;
99use Magento \Eav \Model \Entity \Attribute \Source \BooleanFactory ;
1010use Magento \Framework \Serialize \Serializer \Json as Serializer ;
11- use Magento \Store \Api \StoreResolverInterface ;
11+ use Magento \Store \Model \StoreManagerInterface ;
12+ use Magento \Store \Api \Data \StoreInterface ;
1213use Magento \Framework \App \CacheInterface ;
1314use Magento \Eav \Model \Entity \Attribute \AbstractAttribute ;
1415use Magento \Eav \Model \Entity \Attribute \Source \AbstractSource ;
@@ -31,9 +32,14 @@ class DefaultFrontendTest extends \PHPUnit_Framework_TestCase
3132 private $ serializerMock ;
3233
3334 /**
34- * @var StoreResolverInterface |\PHPUnit_Framework_MockObject_MockObject
35+ * @var StoreManagerInterface |\PHPUnit_Framework_MockObject_MockObject
3536 */
36- private $ storeResolverMock ;
37+ private $ storeManagerMock ;
38+
39+ /**
40+ * @var StoreInterface|\PHPUnit_Framework_MockObject_MockObject
41+ */
42+ private $ storeMock ;
3743
3844 /**
3945 * @var CacheInterface|\PHPUnit_Framework_MockObject_MockObject
@@ -64,7 +70,9 @@ protected function setUp()
6470 ->getMock ();
6571 $ this ->serializerMock = $ this ->getMockBuilder (Serializer::class)
6672 ->getMock ();
67- $ this ->storeResolverMock = $ this ->getMockBuilder (StoreResolverInterface::class)
73+ $ this ->storeManagerMock = $ this ->getMockBuilder (StoreManagerInterface::class)
74+ ->getMockForAbstractClass ();
75+ $ this ->storeMock = $ this ->getMockBuilder (StoreInterface::class)
6876 ->getMockForAbstractClass ();
6977 $ this ->cacheMock = $ this ->getMockBuilder (CacheInterface::class)
7078 ->getMockForAbstractClass ();
@@ -83,7 +91,7 @@ protected function setUp()
8391 [
8492 '_attrBooleanFactory ' => $ this ->booleanFactory ,
8593 'cache ' => $ this ->cacheMock ,
86- 'storeResolver ' => $ this ->storeResolverMock ,
94+ 'storeManager ' => $ this ->storeManagerMock ,
8795 'serializer ' => $ this ->serializerMock ,
8896 '_attribute ' => $ this ->attributeMock ,
8997 'cacheTags ' => $ this ->cacheTags
@@ -188,8 +196,11 @@ public function testGetSelectOptions()
188196 $ options = ['option1 ' , 'option2 ' ];
189197 $ serializedOptions = "{['option1', 'option2']} " ;
190198
191- $ this ->storeResolverMock ->expects ($ this ->once ())
192- ->method ('getCurrentStoreId ' )
199+ $ this ->storeManagerMock ->expects ($ this ->once ())
200+ ->method ('getStore ' )
201+ ->willReturn ($ this ->storeMock );
202+ $ this ->storeMock ->expects ($ this ->once ())
203+ ->method ('getId ' )
193204 ->willReturn ($ storeId );
194205 $ this ->attributeMock ->expects ($ this ->once ())
195206 ->method ('getAttributeCode ' )
0 commit comments