assertInstanceOf( Email::class, Email::fromString($this->email) ); } public function testCannotBeCreatedFromInvalidEmailAddress(): void { $this->expectException(InvalidArgumentException::class); Email::fromString('invalid'); } public function testCanBeUsedAsString(): void { $this->assertEquals( $this->email, Email::fromString($this->email) ); } }