Skip to content

Commit 0a3b7dc

Browse files
author
Vignesh C
committed
validation condition checker bug fix
1 parent 88062ed commit 0a3b7dc

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/TestCaseGenerator.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected function getValue($param, $rules)
123123
$value = $this->faker->date($format);
124124
break;
125125
}
126-
126+
127127
return $value;
128128
}
129129

@@ -147,7 +147,7 @@ protected function isEmail($rules)
147147
*/
148148
protected function isCompanyName($rules, $param)
149149
{
150-
return strpos('company', $param) >= 0 && in_array('string', $rules);
150+
return strpos('company', $param) !== false && in_array('string', $rules);
151151
}
152152

153153
/**
@@ -159,7 +159,7 @@ protected function isCompanyName($rules, $param)
159159
*/
160160
protected function isAddress($rules, $param)
161161
{
162-
return strpos('address', $param) >= 0 && in_array('string', $rules);
162+
return strpos('address', $param) !== false && in_array('string', $rules);
163163
}
164164

165165
/**
@@ -171,7 +171,7 @@ protected function isAddress($rules, $param)
171171
*/
172172
protected function isName($rules, $param)
173173
{
174-
return strpos('name', $param) >= 0 && in_array('string', $rules);
174+
return strpos('name', $param) !== false && in_array('string', $rules);
175175
}
176176

177177
/**
@@ -183,7 +183,7 @@ protected function isName($rules, $param)
183183
*/
184184
protected function isStreetName($rules, $param)
185185
{
186-
return strpos('street', $param) >= 0 && in_array('string', $rules);
186+
return strpos('street', $param) !== false && in_array('string', $rules);
187187
}
188188

189189
/**
@@ -195,7 +195,7 @@ protected function isStreetName($rules, $param)
195195
*/
196196
protected function isStreetAddress($rules, $param)
197197
{
198-
return strpos('street_address', $param) >= 0 && in_array('string', $rules);
198+
return strpos('street_address', $param) !== false && in_array('string', $rules);
199199
}
200200

201201
/**
@@ -207,7 +207,7 @@ protected function isStreetAddress($rules, $param)
207207
*/
208208
protected function isCity($rules, $param)
209209
{
210-
return strpos('city', $param) >= 0 && in_array('string', $rules);
210+
return strpos('city', $param) !== false && in_array('string', $rules);
211211
}
212212

213213
/**
@@ -219,7 +219,7 @@ protected function isCity($rules, $param)
219219
*/
220220
protected function isState($rules, $param)
221221
{
222-
return strpos('state', $param) >= 0 && in_array('string', $rules);
222+
return strpos('state', $param) !== false && in_array('string', $rules);
223223
}
224224

225225
/**
@@ -231,7 +231,7 @@ protected function isState($rules, $param)
231231
*/
232232
protected function isCountry($rules, $param)
233233
{
234-
return strpos('country', $param) >= 0 && in_array('string', $rules);
234+
return strpos('country', $param) !== false && in_array('string', $rules);
235235
}
236236

237237
/**
@@ -243,7 +243,7 @@ protected function isCountry($rules, $param)
243243
*/
244244
protected function isZip($rules, $param)
245245
{
246-
return (strpos('zip', $param) >= 0 || strpos('pin', $param) > 0 ) && in_array('string', $rules);
246+
return (strpos('zip', $param) !== false || strpos('pin', $param) !== false ) && in_array('string', $rules);
247247
}
248248

249249
/**
@@ -254,7 +254,7 @@ protected function isZip($rules, $param)
254254
*/
255255
protected function isLatitude($param)
256256
{
257-
return strpos('latitude', $param) >= 0;
257+
return strpos('latitude', $param) !== false;
258258
}
259259

260260
/**
@@ -265,7 +265,7 @@ protected function isLatitude($param)
265265
*/
266266
protected function isLongitude($param)
267267
{
268-
return strpos('longitude', $param) > 0;
268+
return strpos('longitude', $param) !== false;
269269
}
270270

271271
/**
@@ -276,7 +276,7 @@ protected function isLongitude($param)
276276
*/
277277
protected function isPhone($param)
278278
{
279-
return strpos('phone', $param) > 0 || strpos('mobile', $param);
279+
return strpos('phone', $param) !== false || strpos('mobile', $param) !== false;
280280
}
281281

282282
/**

0 commit comments

Comments
 (0)