Skip to content

Commit 9f16e22

Browse files
committed
Remove tests enforcing a DriverException for null values in setValue
The contract of the method says that the argument type is `string|bool|array`. Passing null does not respect the contract. So there is no reason for the driver testsuite to expect drivers to throw a DriverException for this case.
1 parent fa23e56 commit 9f16e22

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

tests/Form/GeneralTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,18 +368,17 @@ public function testSetInvalidValueInField(string $field, $value): void
368368

369369
public static function provideInvalidValues(): iterable
370370
{
371-
$nullValue = ['null', null];
372371
$trueValue = ['true', true];
373372
$falseValue = ['false', false];
374373
$arrayValue = ['array', ['bad']];
375374
$stringValue = ['string', 'updated'];
376375

377376
$scenarios = [
378377
// field type, name or id, list of values to check
379-
['file', 'about', [$nullValue, $trueValue, $falseValue, $arrayValue]],
380-
['textarea', 'notes', [$nullValue, $trueValue, $falseValue, $arrayValue]],
381-
['text', 'first_name', [$nullValue, $trueValue, $falseValue, $arrayValue]],
382-
['button', 'submit', [$nullValue, $trueValue, $falseValue, $arrayValue, $stringValue]],
378+
['file', 'about', [$trueValue, $falseValue, $arrayValue]],
379+
['textarea', 'notes', [$trueValue, $falseValue, $arrayValue]],
380+
['text', 'first_name', [$trueValue, $falseValue, $arrayValue]],
381+
['button', 'submit', [$trueValue, $falseValue, $arrayValue, $stringValue]],
383382
];
384383

385384
foreach ($scenarios as [$fieldType, $fieldNameOrId, $values]) {

tests/Form/Html5Test.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,20 +179,19 @@ public function testSetInvalidValueInField(string $field, $value): void
179179

180180
public static function provideInvalidValues(): iterable
181181
{
182-
$nullValue = ['null', null];
183182
$trueValue = ['true', true];
184183
$falseValue = ['false', false];
185184
$arrayValue = ['empty array', []];
186185

187186
$scenarios = [
188187
// field type, name or id, list of values to check
189-
['url', 'url', [$nullValue, $trueValue, $falseValue, $arrayValue]],
190-
['email', 'email', [$nullValue, $trueValue, $falseValue, $arrayValue]],
191-
['number', 'number', [$nullValue, $trueValue, $falseValue, $arrayValue]],
192-
['search', 'search', [$nullValue, $trueValue, $falseValue, $arrayValue]],
193-
['color', 'color', [$nullValue, $trueValue, $falseValue, $arrayValue]],
194-
['date', 'date', [$nullValue, $trueValue, $falseValue, $arrayValue]],
195-
['time', 'time', [$nullValue, $trueValue, $falseValue, $arrayValue]],
188+
['url', 'url', [$trueValue, $falseValue, $arrayValue]],
189+
['email', 'email', [$trueValue, $falseValue, $arrayValue]],
190+
['number', 'number', [$trueValue, $falseValue, $arrayValue]],
191+
['search', 'search', [$trueValue, $falseValue, $arrayValue]],
192+
['color', 'color', [$trueValue, $falseValue, $arrayValue]],
193+
['date', 'date', [$trueValue, $falseValue, $arrayValue]],
194+
['time', 'time', [$trueValue, $falseValue, $arrayValue]],
196195
];
197196

198197
foreach ($scenarios as [$fieldType, $fieldNameOrId, $values]) {

0 commit comments

Comments
 (0)