Add in/inArray tests

- Make nameFields void (modifies array by ref)
This commit is contained in:
2024-09-25 20:03:17 -04:00
parent 9a2cf4c204
commit a3ad158dfe
14 changed files with 140 additions and 37 deletions

View File

@@ -84,8 +84,8 @@ class ParametersTest extends TestCase
#[TestDox('nameFields() succeeds')]
public function testNameFieldsSucceeds(): void
{
$named = Parameters::nameFields(
[Field::equal('it', 17), Field::equal('also', 22, ':also'), Field::equal('other', 24)]);
$named = [Field::equal('it', 17), Field::equal('also', 22, ':also'), Field::equal('other', 24)];
Parameters::nameFields($named);
$this->assertCount(3, $named, 'There should be 3 parameters in the array');
$this->assertEquals(':field0', $named[0]->paramName, 'Parameter 1 not named correctly');
$this->assertEquals(':also', $named[1]->paramName, 'Parameter 2 not named correctly');