Допокрытие ArrayAccess-методов

This commit is contained in:
2021-12-12 11:09:12 +08:00
parent b4af189292
commit 294a3ef2f3
4 changed files with 68 additions and 20 deletions

View File

@@ -93,6 +93,7 @@ class BasicTestCase extends TestCase
* @param Entity|EntityCollection $entity
* @param array|null $json_structure
* @covers \AtolOnline\Entities\Entity::__toString
* @covers \AtolOnline\Entities\Entity::toArray
* @covers \AtolOnline\Entities\Entity::jsonSerialize
* @covers \AtolOnline\Collections\EntityCollection::jsonSerialize
* @throws Exception
@@ -100,6 +101,8 @@ class BasicTestCase extends TestCase
public function assertIsAtolable(Entity|EntityCollection $entity, ?array $json_structure = null): void
{
$this->assertIsArray($entity->jsonSerialize());
$this->assertIsArray($entity->toArray());
$this->assertEquals($entity->jsonSerialize(), $entity->toArray());
$this->assertIsString((string)$entity);
$this->assertJson((string)$entity);
if (!is_null($json_structure)) {