@@ -29,9 +29,9 @@ class AdminConfigTest extends \PHPUnit_Framework_TestCase
29
29
private $ objectManager ;
30
30
31
31
/**
32
- * @var \Magento\Store \Model\StoreManagerInterface | \PHPUnit_Framework_MockObject_MockObject
32
+ * @var \Magento\Backend \Model\UrlFactory | \PHPUnit_Framework_MockObject_MockObject
33
33
*/
34
- private $ storeManagerMock ;
34
+ private $ backendUrlFactory ;
35
35
36
36
/**
37
37
* @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject
@@ -56,13 +56,10 @@ protected function setUp()
56
56
$ this ->validatorFactory = $ this ->getMockBuilder ('Magento\Framework\ValidatorFactory ' )
57
57
->disableOriginalConstructor ()
58
58
->getMock ();
59
-
60
- $ storeMock = $ this ->getMockBuilder ('\Magento\Store\Model\Store ' )
61
- ->disableOriginalConstructor ()
62
- ->getMock ();
63
- $ storeMock ->expects ($ this ->once ())->method ('getBaseUrl ' )->will ($ this ->returnValue ('/ ' ));
64
- $ this ->storeManagerMock = $ this ->getMockForAbstractClass ('\Magento\Store\Model\StoreManagerInterface ' );
65
- $ this ->storeManagerMock ->expects ($ this ->once ())->method ('getStore ' )->will ($ this ->returnValue ($ storeMock ));
59
+ $ backendUrl = $ this ->getMock ('\Magento\Backend\Model\Url ' , [], [], '' , false );
60
+ $ backendUrl ->expects ($ this ->once ())->method ('getBaseUrl ' )->will ($ this ->returnValue ('/ ' ));
61
+ $ this ->backendUrlFactory = $ this ->getMock ('Magento\Backend\Model\UrlFactory ' , ['create ' ], [], '' , false );
62
+ $ this ->backendUrlFactory ->expects ($ this ->any ())->method ('create ' )->willReturn ($ backendUrl );
66
63
67
64
$ this ->filesystemMock = $ this ->getMock ('\Magento\Framework\Filesystem ' , [], [], '' , false );
68
65
$ dirMock = $ this ->getMockForAbstractClass ('Magento\Framework\Filesystem\Directory\WriteInterface ' );
@@ -99,7 +96,7 @@ public function testSetCookiePathNonDefault()
99
96
'validatorFactory ' => $ this ->validatorFactory ,
100
97
'request ' => $ this ->requestMock ,
101
98
'frontNameResolver ' => $ mockFrontNameResolver ,
102
- 'storeManager ' => $ this ->storeManagerMock ,
99
+ 'backendUrlFactory ' => $ this ->backendUrlFactory ,
103
100
'filesystem ' => $ this ->filesystemMock ,
104
101
]
105
102
);
@@ -134,7 +131,7 @@ public function testSetSessionNameByConstructor()
134
131
'validatorFactory ' => $ this ->validatorFactory ,
135
132
'request ' => $ this ->requestMock ,
136
133
'sessionName ' => $ sessionName ,
137
- 'storeManager ' => $ this ->storeManagerMock ,
134
+ 'backendUrlFactory ' => $ this ->backendUrlFactory ,
138
135
'filesystem ' => $ this ->filesystemMock ,
139
136
]
140
137
);
0 commit comments