File tree Expand file tree Collapse file tree 5 files changed +13
-11
lines changed
app/code/Magento/Customer/Api/Data
dev/tests/integration/testsuite/Magento/Customer Expand file tree Collapse file tree 5 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -277,15 +277,15 @@ public function setSuffix($suffix);
277
277
* Get gender
278
278
*
279
279
* @api
280
- * @return string |null
280
+ * @return int |null
281
281
*/
282
282
public function getGender ();
283
283
284
284
/**
285
285
* Set gender
286
286
*
287
287
* @api
288
- * @param string $gender
288
+ * @param int $gender
289
289
* @return $this
290
290
*/
291
291
public function setGender ($ gender );
Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ public function testToHtml()
93
93
$ this ->assertNotContains ('field-confirmation ' , $ result );
94
94
$ this ->assertNotContains ('_accountconfirmation ' , $ result );
95
95
96
- // Prefix is present but empty
97
- $ this ->assertRegExp ('/<input id="_accountprefix"[^>]*value=""/ ' , $ result );
96
+ // Prefix is present and not empty
97
+ $ this ->assertRegExp ('/<input id="_accountprefix"[^>]*value="Mr. "/ ' , $ result );
98
98
99
99
// Does not contain send email controls
100
100
$ this ->assertNotContains ('<input id="_accountsendemail" ' , $ result );
Original file line number Diff line number Diff line change @@ -95,11 +95,11 @@ public function tearDown()
95
95
*/
96
96
public function testGetCustomer ()
97
97
{
98
- $ expectedCustomer = $ this ->_loadCustomer ();
99
- $ actualCustomer = $ this ->_block ->getCustomer ();
100
- foreach ($ expectedCustomer -> __toArray () as $ property => $ value ) {
98
+ $ expectedCustomerData = $ this ->_loadCustomer ()-> __toArray ();
99
+ $ actualCustomerData = $ this ->_block ->getCustomer ()-> __toArray ();
100
+ foreach ($ expectedCustomerData as $ property => $ value ) {
101
101
$ expectedValue = is_numeric ($ value ) ? intval ($ value ) : $ value ;
102
- $ actualValue = $ actualCustomer -> __toArray () [$ property ];
102
+ $ actualValue = isset ( $ actualCustomerData [ $ property ]) ? $ actualCustomerData [$ property ] : null ;
103
103
$ actualValue = is_numeric ($ actualValue ) ? intval ($ actualValue ) : $ actualValue ;
104
104
$ this ->assertEquals ($ expectedValue , $ actualValue );
105
105
}
Original file line number Diff line number Diff line change @@ -101,12 +101,17 @@ public function testGetCustomerAttributeMetadata()
101
101
'website_id ' => 1 ,
102
102
'store_id ' => 1 ,
103
103
'group_id ' => 1 ,
104
+ 'prefix ' => 'Mr. ' ,
104
105
'firstname ' => 'John ' ,
106
+ 'middlename ' => 'A ' ,
105
107
'lastname ' => 'Smith ' ,
108
+ 'suffix ' => 'Esq. ' ,
106
109
'email ' => 'customer@example.com ' ,
107
110
'default_billing ' => '1 ' ,
108
111
'default_shipping ' => '1 ' ,
109
112
'disable_auto_group_change ' => 0 ,
113
+ 'taxvat ' => '12 ' ,
114
+ 'gender ' => 0
110
115
];
111
116
112
117
$ customer = $ this ->customerRepository ->getById (1 );
Original file line number Diff line number Diff line change 17
17
->setGroupId (1 )
18
18
->setStoreId (1 )
19
19
->setIsActive (1 )
20
- ->setCreatedIn ('Store Name ' )
21
20
->setPrefix ('Mr. ' )
22
21
->setFirstname ('John ' )
23
22
->setMiddlename ('A ' )
24
23
->setLastname ('Smith ' )
25
24
->setSuffix ('Esq. ' )
26
- ->setDob ('1970-01-01 ' )
27
25
->setDefaultBilling (1 )
28
26
->setDefaultShipping (1 )
29
27
->setTaxvat ('12 ' )
30
- ->setConfirmation ('a4fg7h893e39d ' )
31
28
->setGender (0 );
32
29
$ customer ->isObjectNew (true );
33
30
$ customer ->save ();
You can’t perform that action at this time.
0 commit comments