use PHPUnit\Framework\TestCase;
use Symfony\Component\Mime\Address;
class AddressTest extends TestCase
{ public function testConstructor() { $a =
new Address('fabien@symfonï.com'
);
$this->
assertEquals('fabien@symfonï.com',
$a->
getAddress());
$this->
assertEquals('fabien@xn--symfon-nwa.com',
$a->
toString());
$this->
assertEquals('fabien@xn--symfon-nwa.com',
$a->
getEncodedAddress());
$a =
new Address('fabien@symfonï.com', 'Fabien'
);
$this->
assertEquals('Fabien',
$a->
getName());
$this->
assertEquals('fabien@symfonï.com',
$a->
getAddress());
$this->
assertEquals('"Fabien" <fabien@xn--symfon-nwa.com>',
$a->
toString());
$this->
assertEquals('fabien@xn--symfon-nwa.com',
$a->
getEncodedAddress());
} public function testConstructorWithInvalidAddress() { $this->
expectException(\InvalidArgumentException::
class);