Реализован и покрыт тестами AgentInfo (переименован из Agent)

This commit is contained in:
2021-11-27 17:59:50 +08:00
parent 16c8d8a676
commit e0d792d3a4
3 changed files with 289 additions and 3 deletions

View File

@@ -67,16 +67,16 @@ class BasicTestCase extends TestCase
* Тестирует является ли объект приводимым к json-строке согласно схеме АТОЛ Онлайн
*
* @param Entity $entity
* @param array $json_structure
* @param array|null $json_structure
* @covers \AtolOnline\Entities\Entity::jsonSerialize
* @covers \AtolOnline\Entities\Entity::__toString
*/
public function assertAtolable(Entity $entity, array $json_structure = []): void
public function assertAtolable(Entity $entity, ?array $json_structure = null): void
{
$this->assertIsArray($entity->jsonSerialize());
$this->assertIsString((string)$entity);
$this->assertJson((string)$entity);
if ($json_structure) {
if (!is_null($json_structure)) {
$this->assertEquals(json_encode($json_structure), (string)$entity);
}
}