assertJson( json_encode(new ContactBirthday(new \DateTime())) ); } public function test__construct() { $this->assertInstanceOf( ContactBirthday::class, new ContactBirthday(new \DateTime()) ); } public function testDateTimeInterfaceException() { $this->expectException(\TypeError::class); new ContactBirthday('never'); } }