Skip to content

Commit fc02741

Browse files
author
okarpenko
committed
MAGETWO-37818: Customer invalid email message is not displayed
1 parent 9b451a0 commit fc02741

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ValidateTest.php

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © 2015 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
// @codingStandardsIgnoreFile
76

87
namespace Magento\Customer\Test\Unit\Controller\Adminhtml\Index;
98

@@ -60,6 +59,9 @@ class ValidateTest extends \PHPUnit_Framework_TestCase
6059
/** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Controller\Result\Json */
6160
protected $resultJson;
6261

62+
/** @var \Magento\Customer\Controller\Adminhtml\Index\Validate */
63+
protected $controller;
64+
6365
public function setUp()
6466
{
6567
$this->customer = $this->getMockForAbstractClass(
@@ -130,6 +132,21 @@ public function setUp()
130132
false
131133
);
132134
$this->resultJsonFactory->expects($this->once())->method('create')->willReturn($this->resultJson);
135+
136+
$objectHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
137+
$this->controller = $objectHelper->getObject(
138+
'Magento\Customer\Controller\Adminhtml\Index\Validate',
139+
[
140+
'request' => $this->request,
141+
'response' => $this->response,
142+
'customerDataFactory' => $this->customerDataFactory,
143+
'formFactory' => $this->formFactory,
144+
'extensibleDataObjectConverter' => $this->extensibleDataObjectConverter,
145+
'customerAccountManagement' => $this->customerAccountManagement,
146+
'resultJsonFactory' => $this->resultJsonFactory,
147+
'dataObjectHelper' => $this->dataObjectHelper,
148+
]
149+
);
133150
}
134151

135152
public function testExecute()
@@ -169,7 +186,7 @@ public function testExecute()
169186
->method('validate')
170187
->willReturn($validationResult);
171188

172-
$this->getController()->execute();
189+
$this->controller->execute();
173190
}
174191

175192
public function testExecuteWithoutAddresses()
@@ -208,7 +225,7 @@ public function testExecuteWithoutAddresses()
208225
->method('validate')
209226
->willReturn($validationResult);
210227

211-
$this->getController()->execute();
228+
$this->controller->execute();
212229
}
213230

214231
public function testExecuteWithException()
@@ -254,24 +271,6 @@ public function testExecuteWithException()
254271
->method('validate')
255272
->willReturn($validationResult);
256273

257-
$this->getController()->execute();
258-
}
259-
260-
public function getController()
261-
{
262-
$objectHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
263-
return $objectHelper->getObject(
264-
'Magento\Customer\Controller\Adminhtml\Index\Validate',
265-
[
266-
'request' => $this->request,
267-
'response' => $this->response,
268-
'customerDataFactory' => $this->customerDataFactory,
269-
'formFactory' => $this->formFactory,
270-
'extensibleDataObjectConverter' => $this->extensibleDataObjectConverter,
271-
'customerAccountManagement' => $this->customerAccountManagement,
272-
'resultJsonFactory' => $this->resultJsonFactory,
273-
'dataObjectHelper' => $this->dataObjectHelper,
274-
]
275-
);
274+
$this->controller->execute();
276275
}
277276
}

0 commit comments

Comments
 (0)