Skip to content

Commit 280e520

Browse files
committed
MAGETWO-48286: "Create/Edit Customer" Admin forms do not support data validation without refreshing
1 parent 1cd2936 commit 280e520

File tree

1 file changed

+4
-66
lines changed
  • dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml

1 file changed

+4
-66
lines changed

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

Lines changed: 4 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function testSaveActionWithInvalidFormData()
108108
*/
109109
$this->assertEquals(
110110
$post,
111-
$this->objectManager->get('Magento\Backend\Model\Session')->getCustomerData()
111+
$this->objectManager->get('Magento\Backend\Model\Session')->getCustomerFormData()
112112
);
113113
$this->assertRedirect($this->stringStartsWith($this->_baseControllerUrl . 'new'));
114114
}
@@ -144,7 +144,7 @@ public function testSaveActionWithInvalidCustomerAddressData()
144144
*/
145145
$this->assertEquals(
146146
$post,
147-
$this->objectManager->get('Magento\Backend\Model\Session')->getCustomerData()
147+
$this->objectManager->get('Magento\Backend\Model\Session')->getCustomerFormData()
148148
);
149149
$this->assertRedirect($this->stringStartsWith($this->_baseControllerUrl . 'new'));
150150
}
@@ -183,7 +183,7 @@ public function testSaveActionWithValidCustomerDataAndValidAddressData()
183183
$this->getRequest()->setParam('back', '1');
184184

185185
// Emulate setting customer data to session in editAction
186-
$this->objectManager->get('Magento\Backend\Model\Session')->setCustomerData($post);
186+
$this->objectManager->get('Magento\Backend\Model\Session')->setCustomerFormData($post);
187187

188188
$this->dispatch('backend/customer/index/save');
189189
/**
@@ -480,7 +480,7 @@ public function testSaveActionCoreException()
480480
);
481481
$this->assertEquals(
482482
$post,
483-
Bootstrap::getObjectManager()->get('Magento\Backend\Model\Session')->getCustomerData()
483+
Bootstrap::getObjectManager()->get('Magento\Backend\Model\Session')->getCustomerFormData()
484484
);
485485
$this->assertRedirect($this->stringStartsWith($this->_baseControllerUrl . 'new/key/'));
486486
}
@@ -489,68 +489,6 @@ public function testSaveActionCoreException()
489489
* @magentoDataFixture Magento/Customer/_files/customer_sample.php
490490
*/
491491
public function testEditAction()
492-
{
493-
$customerData = [
494-
'customer_id' => '1',
495-
'account' => [
496-
'middlename' => 'new middlename',
497-
'group_id' => 1,
498-
'website_id' => 1,
499-
'firstname' => 'new firstname',
500-
'lastname' => 'new lastname',
501-
'email' => 'customer@example.com',
502-
'default_shipping' => '_item1',
503-
'new_password' => 'auto',
504-
'sendemail_store_id' => '1',
505-
'sendemail' => '1',
506-
'created_at' => '2000-01-01 00:00:00',
507-
'customer_address' => [
508-
'1' => [
509-
'firstname' => 'update firstname',
510-
'lastname' => 'update lastname',
511-
'street' => ['update street'],
512-
'city' => 'update city',
513-
'country_id' => 'US',
514-
'postcode' => '01001',
515-
'telephone' => '+7000000001',
516-
],
517-
'_item1' => [
518-
'firstname' => 'default firstname',
519-
'lastname' => 'default lastname',
520-
'street' => ['default street'],
521-
'city' => 'default city',
522-
'country_id' => 'US',
523-
'postcode' => '01001',
524-
'telephone' => '+7000000001',
525-
],
526-
'_template_' => [
527-
'firstname' => '',
528-
'lastname' => '',
529-
'street' => [],
530-
'city' => '',
531-
'country_id' => 'US',
532-
'postcode' => '',
533-
'telephone' => '',
534-
],
535-
],
536-
],
537-
];
538-
/**
539-
* set customer data
540-
*/
541-
Bootstrap::getObjectManager()->get('Magento\Backend\Model\Session')->setCustomerData($customerData);
542-
$this->getRequest()->setParam('id', 1);
543-
$this->dispatch('backend/customer/index/edit');
544-
$body = $this->getResponse()->getBody();
545-
546-
// verify
547-
$this->assertContains('<h1 class="page-title">new firstname new lastname</h1>', $body);
548-
}
549-
550-
/**
551-
* @magentoDataFixture Magento/Customer/_files/customer_sample.php
552-
*/
553-
public function testEditActionNoSessionData()
554492
{
555493
$this->getRequest()->setParam('id', 1);
556494
$this->dispatch('backend/customer/index/edit');

0 commit comments

Comments
 (0)