예제 #1
0
 /**
  * @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());
 }
예제 #2
0
파일: Transport.php 프로젝트: fuelphp/email
 /**
  * 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;
 }