Skip to content

Commit 73b9007

Browse files
author
Tommy Quissens
committed
fixed unit test for checkout configprovider
1 parent 40e8a16 commit 73b9007

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

app/code/Magento/Customer/Test/Unit/Model/Checkout/ConfigProviderTest.php

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ConfigProviderTest extends \PHPUnit\Framework\TestCase
2929
/**
3030
* @var UrlInterface|\PHPUnit_Framework_MockObject_MockObject
3131
*/
32-
protected $urlBuilder;
32+
protected $customerUrl;
3333

3434
/**
3535
* @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject
@@ -49,12 +49,9 @@ protected function setUp()
4949
'',
5050
false
5151
);
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+
5855
$this->scopeConfig = $this->getMockForAbstractClass(
5956
\Magento\Framework\App\Config\ScopeConfigInterface::class,
6057
[],
@@ -72,7 +69,7 @@ protected function setUp()
7269
);
7370

7471
$this->provider = new ConfigProvider(
75-
$this->urlBuilder,
72+
$this->customerUrl,
7673
$this->storeManager,
7774
$this->scopeConfig
7875
);
@@ -83,9 +80,8 @@ public function testGetConfigWithoutRedirect()
8380
$loginUrl = 'http://url.test/customer/login';
8481
$baseUrl = 'http://base-url.test';
8582

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')
8985
->willReturn($loginUrl);
9086
$this->storeManager->expects($this->once())
9187
->method('getStore')
@@ -112,9 +108,8 @@ public function testGetConfig()
112108
$loginUrl = 'http://base-url.test/customer/login';
113109
$baseUrl = 'http://base-url.test';
114110

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')
118113
->willReturn($loginUrl);
119114
$this->storeManager->expects($this->once())
120115
->method('getStore')

0 commit comments

Comments
 (0)