Пример #1
0
 public function testSubjectAccessors()
 {
     $this->iniSet('sendmail_from', '');
     $mail = new \r8\Mail($this->getTestTransport());
     $this->assertFalse($mail->subjectExists());
     $this->assertNull($mail->getSubject());
     $this->assertSame($mail, $mail->setSubject("Hey there"));
     $this->assertTrue($mail->subjectExists());
     $this->assertSame("Hey there", $mail->getSubject());
     $this->assertSame($mail, $mail->clearSubject());
     $this->assertFalse($mail->subjectExists());
     $this->assertNull($mail->getSubject());
     $this->assertSame($mail, $mail->setSubject("Some\nkind of" . chr(1) . " thing"));
     $this->assertTrue($mail->subjectExists());
     $this->assertSame("Some kind of thing", $mail->getSubject());
     $this->assertSame($mail, $mail->setSubject("  "));
     $this->assertFalse($mail->subjectExists());
     $this->assertNull($mail->getSubject());
 }