ContactBirthdayTest.php 593 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace CMText\RichContent\Common;
  3. use PHPUnit\Framework\TestCase;
  4. class ContactBirthdayTest extends TestCase
  5. {
  6. public function testJsonSerialize()
  7. {
  8. $this->assertJson( json_encode(new ContactBirthday(new \DateTime())) );
  9. }
  10. public function test__construct()
  11. {
  12. $this->assertInstanceOf(
  13. ContactBirthday::class,
  14. new ContactBirthday(new \DateTime())
  15. );
  16. }
  17. public function testDateTimeInterfaceException()
  18. {
  19. $this->expectException(\TypeError::class);
  20. new ContactBirthday('never');
  21. }
  22. }