assertIsObject($entity); $this->assertIsObject($entity->jsonSerialize()); $this->assertIsString((string)$entity); $this->assertJson((string)$entity); if ($json_structure) { $this->assertEquals(json_encode($json_structure), (string)$entity); } } /** * Провайдер валидных телефонов * * @return array> */ public function providerValidPhones(): array { return [ ['+79991234567', '+79991234567'], ['79991234567', '+79991234567'], ['89991234567', '+89991234567'], ['+7 999 123 45 67', '+79991234567'], ['+7 (999) 123-45-67', '+79991234567'], ["+7 %(?9:9\"9')abc\r123\n45\t67\0", '+79991234567'], ]; } /** * Провайдер валидных email-ов * * @return array> */ public function providerValidEmails(): array { return [ ['abc@mail.com'], ['abc-d@mail.com'], ['abc.def@mail.com'], ['abc.def@mail.org'], ['abc.def@mail-archive.com'], ]; } }