@@ -303,30 +303,39 @@ public function testSaveActionCoreExceptionFormatFormData()
303
303
{
304
304
$ post = [
305
305
'customer ' => [
306
+ 'middlename ' => 'test middlename ' ,
306
307
'website_id ' => 1 ,
308
+ 'firstname ' => 'test firstname ' ,
309
+ 'lastname ' => 'test lastname ' ,
307
310
308
311
'dob ' => '12/3/1996 ' ,
309
312
],
310
313
];
311
- $ postFormatted = [
312
- 'customer ' => [
313
- 'website_id ' => 1 ,
314
-
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
+
320
+ 'dob ' => '1996-12-03 ' ,
317
321
];
318
- $ this ->getRequest ()->setPostValue ($ post );
322
+
323
+ $ this ->getRequest ()->setPostValue ($ post )->setMethod (HttpRequest::METHOD_POST );
319
324
$ this ->dispatch ('backend/customer/index/save ' );
320
325
/*
321
- * Check that error message is set
322
- */
326
+ * Check that error message is set
327
+ */
323
328
$ this ->assertSessionMessages (
324
329
$ this ->equalTo (['A customer with the same email address already exists in an associated website. ' ]),
325
330
\Magento \Framework \Message \MessageInterface::TYPE_ERROR
326
331
);
332
+
333
+ $ customerFormData = Bootstrap::getObjectManager ()
334
+ ->get (\Magento \Backend \Model \Session::class)
335
+ ->getCustomerFormData ();
327
336
$ this ->assertEquals (
328
- $ postFormatted ,
329
- Bootstrap:: getObjectManager ()-> get (\ Magento \ Backend \ Model \Session::class)-> getCustomerFormData () ,
337
+ $ postCustomerFormatted ,
338
+ $ customerFormData [ ' customer ' ] ,
330
339
'Customer form data should be formatted '
331
340
);
332
341
$ this ->assertRedirect ($ this ->stringStartsWith ($ this ->_baseControllerUrl . 'new/key/ ' ));
0 commit comments