Fix empty array check

This commit is contained in:
2024-07-04 13:16:04 -04:00
parent 5201e564ca
commit 1a37b009ea
2 changed files with 21 additions and 6 deletions

View File

@@ -33,6 +33,19 @@ class ParametersTest extends TestCase
'JSON parameter not constructed correctly');
}
public function testJsonSucceedsForArrayWithEmptyArrayParameter(): void
{
$this->assertEquals([':it' => '{"id":18,"urls":[]}'], Parameters::json(':it', ['id' => 18, 'urls' => []]),
'JSON parameter not constructed correctly');
}
#[TestDox('json succeeds for 1D array with empty array parameter')]
public function testJsonSucceedsFor1DArrayWithEmptyArrayParameter(): void
{
$this->assertEquals([':it' => '{"urls":[]}'], Parameters::json(':it', ['urls' => []]),
'JSON parameter not constructed correctly');
}
#[TestDox('json succeeds for stdClass')]
public function testJsonSucceedsForStdClass(): void
{