/** * @covers ::__construct * @group Email */ public function testConstruct() { $email = '*****@*****.**'; $name = 'John Doe'; $object = new Address($email, $name); $this->assertEquals($email, $object->getEmail()); $this->assertEquals($name, $object->getName()); }
/** * Format an address * * @param Address $address * * @return string * * @since 2.0 */ public function formatAddress(Address $address) { $string = $address->getEmail(); if ($address->hasName()) { $name = $address->getName(); if ($this->config['email']['encode_headers']) { $name = $this->encodeMimeHeader($name); } $string = '"' . $name . '" <' . $string . '>'; } return $string; }