@@ -29,7 +29,7 @@ class ConfigProviderTest extends \PHPUnit\Framework\TestCase
29
29
/**
30
30
* @var UrlInterface|\PHPUnit_Framework_MockObject_MockObject
31
31
*/
32
- protected $ urlBuilder ;
32
+ protected $ customerUrl ;
33
33
34
34
/**
35
35
* @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject
@@ -49,12 +49,9 @@ protected function setUp()
49
49
'' ,
50
50
false
51
51
);
52
- $ this ->urlBuilder = $ this ->getMockForAbstractClass (
53
- \Magento \Framework \UrlInterface::class,
54
- [],
55
- '' ,
56
- false
57
- );
52
+
53
+ $ this ->customerUrl = $ this ->createMock (\Magento \Customer \Model \Url::class);
54
+
58
55
$ this ->scopeConfig = $ this ->getMockForAbstractClass (
59
56
\Magento \Framework \App \Config \ScopeConfigInterface::class,
60
57
[],
@@ -72,7 +69,7 @@ protected function setUp()
72
69
);
73
70
74
71
$ this ->provider = new ConfigProvider (
75
- $ this ->urlBuilder ,
72
+ $ this ->customerUrl ,
76
73
$ this ->storeManager ,
77
74
$ this ->scopeConfig
78
75
);
@@ -83,9 +80,8 @@ public function testGetConfigWithoutRedirect()
83
80
$ loginUrl = 'http://url.test/customer/login ' ;
84
81
$ baseUrl = 'http://base-url.test ' ;
85
82
86
- $ this ->urlBuilder ->expects ($ this ->exactly (2 ))
87
- ->method ('getUrl ' )
88
- ->with (Url::ROUTE_ACCOUNT_LOGIN )
83
+ $ this ->customerUrl ->expects ($ this ->exactly (2 ))
84
+ ->method ('getLoginUrl ' )
89
85
->willReturn ($ loginUrl );
90
86
$ this ->storeManager ->expects ($ this ->once ())
91
87
->method ('getStore ' )
@@ -112,9 +108,8 @@ public function testGetConfig()
112
108
$ loginUrl = 'http://base-url.test/customer/login ' ;
113
109
$ baseUrl = 'http://base-url.test ' ;
114
110
115
- $ this ->urlBuilder ->expects ($ this ->exactly (2 ))
116
- ->method ('getUrl ' )
117
- ->with (Url::ROUTE_ACCOUNT_LOGIN )
111
+ $ this ->customerUrl ->expects ($ this ->exactly (2 ))
112
+ ->method ('getLoginUrl ' )
118
113
->willReturn ($ loginUrl );
119
114
$ this ->storeManager ->expects ($ this ->once ())
120
115
->method ('getStore ' )
0 commit comments