Skip to content

Commit 4881ee4

Browse files
author
laughing_man77
committed
Defaults in user create for empty to null.
1 parent 68f1c8c commit 4881ee4

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

includes/Processor/UserCreate.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class UserCreate extends ProcessorEntity
6565
'limitProcessors' => [],
6666
'limitTypes' => ['text'],
6767
'limitValues' => [],
68-
'default' => '',
68+
'default' => null,
6969
],
7070
'active' => [
7171
'description' => 'The active flag for the user.',
@@ -83,7 +83,7 @@ class UserCreate extends ProcessorEntity
8383
'limitProcessors' => [],
8484
'limitTypes' => ['text'],
8585
'limitValues' => ['Mr', 'Ms', 'Miss', 'Mrs', 'Dr', 'Prof', 'Hon'],
86-
'default' => '',
86+
'default' => null,
8787
],
8888
'name_first' => [
8989
'description' => 'The first name of the user.',
@@ -92,7 +92,7 @@ class UserCreate extends ProcessorEntity
9292
'limitProcessors' => [],
9393
'limitTypes' => ['text'],
9494
'limitValues' => [],
95-
'default' => '',
95+
'default' => null,
9696
],
9797
'name_last' => [
9898
'description' => 'The last name of the user.',
@@ -101,7 +101,7 @@ class UserCreate extends ProcessorEntity
101101
'limitProcessors' => [],
102102
'limitTypes' => ['text'],
103103
'limitValues' => [],
104-
'default' => '',
104+
'default' => null,
105105
],
106106
'company' => [
107107
'description' => 'The company of the user.',
@@ -110,7 +110,7 @@ class UserCreate extends ProcessorEntity
110110
'limitProcessors' => [],
111111
'limitTypes' => ['text'],
112112
'limitValues' => [],
113-
'default' => '',
113+
'default' => null,
114114
],
115115
'website' => [
116116
'description' => 'The website of the user.',
@@ -119,7 +119,7 @@ class UserCreate extends ProcessorEntity
119119
'limitProcessors' => [],
120120
'limitTypes' => ['text'],
121121
'limitValues' => [],
122-
'default' => '',
122+
'default' => null,
123123
],
124124
'address_street' => [
125125
'description' => 'The street address of the user.',
@@ -128,7 +128,7 @@ class UserCreate extends ProcessorEntity
128128
'limitProcessors' => [],
129129
'limitTypes' => ['text'],
130130
'limitValues' => [],
131-
'default' => '',
131+
'default' => null,
132132
],
133133
'address_suburb' => [
134134
'description' => 'The suburb of the user.',
@@ -137,7 +137,7 @@ class UserCreate extends ProcessorEntity
137137
'limitProcessors' => [],
138138
'limitTypes' => ['text'],
139139
'limitValues' => [],
140-
'default' => '',
140+
'default' => null,
141141
],
142142
'address_city' => [
143143
'description' => 'The city of the user.',
@@ -146,7 +146,7 @@ class UserCreate extends ProcessorEntity
146146
'limitProcessors' => [],
147147
'limitTypes' => ['text'],
148148
'limitValues' => [],
149-
'default' => '',
149+
'default' => null,
150150
],
151151
'address_state' => [
152152
'description' => 'The state of the user.',
@@ -155,7 +155,7 @@ class UserCreate extends ProcessorEntity
155155
'limitProcessors' => [],
156156
'limitTypes' => ['text'],
157157
'limitValues' => [],
158-
'default' => '',
158+
'default' => null,
159159
],
160160
'address_country' => [
161161
'description' => 'The country of the user.',
@@ -164,7 +164,7 @@ class UserCreate extends ProcessorEntity
164164
'limitProcessors' => [],
165165
'limitTypes' => ['text'],
166166
'limitValues' => [],
167-
'default' => '',
167+
'default' => null,
168168
],
169169
'address_postcode' => [
170170
'description' => 'The postcode of the user.',
@@ -173,7 +173,7 @@ class UserCreate extends ProcessorEntity
173173
'limitProcessors' => [],
174174
'limitTypes' => ['text'],
175175
'limitValues' => [],
176-
'default' => '',
176+
'default' => null,
177177
],
178178
'phone_mobile' => [
179179
'description' => 'The mobile phone of the user.',

tests/api/UserCept.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,24 @@
3232
'data' => [
3333
'uid' => 'integer',
3434
'username' => 'string',
35-
'hash' => 'string',
36-
'passwordReset' => 'string',
37-
'passwordResetTtl' => 'string',
35+
'hash' => 'null',
36+
'passwordReset' => 'null',
37+
'passwordResetTtl' => 'null',
3838
'active' => 'integer',
39-
'honorific' => 'string',
40-
'nameFirst' => 'string',
41-
'nameLast' => 'string',
39+
'honorific' => 'null',
40+
'nameFirst' => 'null',
41+
'nameLast' => 'null',
4242
'email' => 'string',
43-
'company' => 'string',
44-
'website' => 'string',
45-
'addressStreet' => 'string',
46-
'addressSuburb' => 'string',
47-
'addressCity' => 'string',
48-
'addressState' => 'string',
49-
'addressCountry' => 'string',
50-
'addressPostcode' => 'string',
51-
'phoneMobile' => 'string',
52-
'phoneWork' => 'string',
43+
'company' => 'null',
44+
'website' => 'null',
45+
'addressStreet' => 'null',
46+
'addressSuburb' => 'null',
47+
'addressCity' => 'null',
48+
'addressState' => 'null',
49+
'addressCountry' => 'null',
50+
'addressPostcode' => 'null',
51+
'phoneMobile' => 'null',
52+
'phoneWork' => 'null',
5353
],
5454
]);
5555
$response = json_decode($I->getResponse(), true);
@@ -69,7 +69,7 @@
6969
'email' => "john$count@foobar.com",
7070
'company' => 'Foobar',
7171
'website' => 'www.foobar.com',
72-
'street_address' => '1 street address',
72+
'address_street' => '1 street address',
7373
'address_suburb' => 'testerton',
7474
'address_city' => 'tester',
7575
'address_state' => 'yale',
@@ -101,8 +101,8 @@
101101
'addressPostcode' => 'string',
102102
'phoneMobile' => 'string',
103103
'phoneWork' => 'string',
104-
'passwordReset' => 'string',
105-
'passwordResetTtl' => 'string',
104+
'passwordReset' => 'null',
105+
'passwordResetTtl' => 'null',
106106
],
107107
]);
108108
$response = json_decode($I->getResponse(), true);
@@ -145,7 +145,7 @@
145145
'email' => "[email protected]",
146146
'company' => 'Foobar',
147147
'website' => 'www.foobar.com',
148-
'street_address' => '1 street address',
148+
'address_street' => '1 street address',
149149
'address_suburb' => 'testerton',
150150
'address_city' => 'tester',
151151
'address_state' => 'yale',

0 commit comments

Comments
 (0)