Add in/inArray; expand Field ctr func names

This commit is contained in:
2024-09-20 20:29:47 -04:00
parent 0a188a80c2
commit e830b1ac3e
28 changed files with 466 additions and 299 deletions

View File

@@ -79,7 +79,8 @@ class ParametersTest extends TestCase
public function testNameFieldsSucceeds(): void
{
$named = Parameters::nameFields([Field::EQ('it', 17), Field::EQ('also', 22, ':also'), Field::EQ('other', 24)]);
$named = Parameters::nameFields(
[Field::equal('it', 17), Field::equal('also', 22, ':also'), Field::equal('other', 24)]);
$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');
@@ -89,7 +90,7 @@ class ParametersTest extends TestCase
public function testAddFieldsSucceeds(): void
{
$this->assertEquals([':a' => 1, ':b' => 'two', ':z' => 18],
Parameters::addFields([Field::EQ('b', 'two', ':b'), Field::EQ('z', 18, ':z')], [':a' => 1]),
Parameters::addFields([Field::equal('b', 'two', ':b'), Field::equal('z', 18, ':z')], [':a' => 1]),
'Field parameters not added correctly');
}