File tree Expand file tree Collapse file tree 2 files changed +30
-8
lines changed
app/code/Magento/Customer Expand file tree Collapse file tree 2 files changed +30
-8
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ class ConfigProvider implements ConfigProviderInterface
22
22
23
23
/**
24
24
* @var UrlInterface
25
+ * @deprecated
26
+ */
27
+ protected $ urlBuilder ;
28
+
29
+ /**
30
+ * @var Url
25
31
*/
26
32
protected $ customerUrl ;
27
33
@@ -31,18 +37,21 @@ class ConfigProvider implements ConfigProviderInterface
31
37
protected $ scopeConfig ;
32
38
33
39
/**
34
- * @param Url $customerUrl
40
+ * @param UrlInterface $urlBuilder
35
41
* @param StoreManagerInterface $storeManager
36
42
* @param ScopeConfigInterface $scopeConfig
43
+ * @param Url $customerUrl
37
44
*/
38
45
public function __construct (
39
- Url $ customerUrl ,
46
+ UrlInterface $ urlBuilder ,
40
47
StoreManagerInterface $ storeManager ,
41
- ScopeConfigInterface $ scopeConfig
48
+ ScopeConfigInterface $ scopeConfig ,
49
+ Url $ customerUrl = null
42
50
) {
43
- $ this ->customerUrl = $ customerUrl ;
51
+ $ this ->urlBuilder = $ urlBuilder ;
44
52
$ this ->storeManager = $ storeManager ;
45
53
$ this ->scopeConfig = $ scopeConfig ;
54
+ $ this ->customerUrl = $ customerUrl ?? \Magento \Framework \App \ObjectManager::getInstance ()->get (\Magento \Customer \Model \Url::class);
46
55
}
47
56
48
57
/**
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class ConfigProviderTest extends \PHPUnit\Framework\TestCase
29
29
/**
30
30
* @var UrlInterface|\PHPUnit_Framework_MockObject_MockObject
31
31
*/
32
- protected $ customerUrl ;
32
+ protected $ urlBuilder ;
33
33
34
34
/**
35
35
* @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject
@@ -41,6 +41,11 @@ class ConfigProviderTest extends \PHPUnit\Framework\TestCase
41
41
*/
42
42
protected $ store ;
43
43
44
+ /**
45
+ * @var Url|\PHPUnit_Framework_MockObject_MockObject
46
+ */
47
+ private $ customerUrl ;
48
+
44
49
protected function setUp ()
45
50
{
46
51
$ this ->storeManager = $ this ->getMockForAbstractClass (
@@ -50,7 +55,12 @@ protected function setUp()
50
55
false
51
56
);
52
57
53
- $ this ->customerUrl = $ this ->createMock (\Magento \Customer \Model \Url::class);
58
+ $ this ->urlBuilder = $ this ->getMockForAbstractClass (
59
+ \Magento \Framework \UrlInterface::class,
60
+ [],
61
+ '' ,
62
+ false
63
+ );
54
64
55
65
$ this ->scopeConfig = $ this ->getMockForAbstractClass (
56
66
\Magento \Framework \App \Config \ScopeConfigInterface::class,
@@ -68,10 +78,13 @@ protected function setUp()
68
78
['getBaseUrl ' ]
69
79
);
70
80
81
+ $ this ->customerUrl = $ this ->createMock (\Magento \Customer \Model \Url::class);
82
+
71
83
$ this ->provider = new ConfigProvider (
72
- $ this ->customerUrl ,
84
+ $ this ->urlBuilder ,
73
85
$ this ->storeManager ,
74
- $ this ->scopeConfig
86
+ $ this ->scopeConfig ,
87
+ $ this ->customerUrl
75
88
);
76
89
}
77
90
You can’t perform that action at this time.
0 commit comments