Skip to content

Commit a9cc22f

Browse files
committed
MAGETWO-97549: Custom Customer Attribute is not updating on one website
1 parent d4ae941 commit a9cc22f

File tree

1 file changed

+20
-11
lines changed
  • dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml

1 file changed

+20
-11
lines changed

dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -303,30 +303,39 @@ public function testSaveActionCoreExceptionFormatFormData()
303303
{
304304
$post = [
305305
'customer' => [
306+
'middlename' => 'test middlename',
306307
'website_id' => 1,
308+
'firstname' => 'test firstname',
309+
'lastname' => 'test lastname',
307310
'email' => '[email protected]',
308311
'dob' => '12/3/1996',
309312
],
310313
];
311-
$postFormatted = [
312-
'customer' => [
313-
'website_id' => 1,
314-
'email' => '[email protected]',
315-
'dob' => '1996-12-03',
316-
],
314+
$postCustomerFormatted = [
315+
'middlename' => 'test middlename',
316+
'website_id' => 1,
317+
'firstname' => 'test firstname',
318+
'lastname' => 'test lastname',
319+
'email' => '[email protected]',
320+
'dob' => '1996-12-03',
317321
];
318-
$this->getRequest()->setPostValue($post);
322+
323+
$this->getRequest()->setPostValue($post)->setMethod(HttpRequest::METHOD_POST);
319324
$this->dispatch('backend/customer/index/save');
320325
/*
321-
* Check that error message is set
322-
*/
326+
* Check that error message is set
327+
*/
323328
$this->assertSessionMessages(
324329
$this->equalTo(['A customer with the same email address already exists in an associated website.']),
325330
\Magento\Framework\Message\MessageInterface::TYPE_ERROR
326331
);
332+
333+
$customerFormData = Bootstrap::getObjectManager()
334+
->get(\Magento\Backend\Model\Session::class)
335+
->getCustomerFormData();
327336
$this->assertEquals(
328-
$postFormatted,
329-
Bootstrap::getObjectManager()->get(\Magento\Backend\Model\Session::class)->getCustomerFormData(),
337+
$postCustomerFormatted,
338+
$customerFormData['customer'],
330339
'Customer form data should be formatted'
331340
);
332341
$this->assertRedirect($this->stringStartsWith($this->_baseControllerUrl . 'new/key/'));

0 commit comments

Comments
 (0)