Esempio n. 1
0
 /**
  * Runs the test.
  */
 public function test()
 {
     $html = file_get_contents(DIR_FILES . '/mail/email.html');
     $text = \Jyxo\Html::toText($html);
     // HTML and plaintext given
     $body = new Body($html, $text);
     $this->assertEquals($html, $body->getMain());
     $this->assertEquals($text, $body->getAlternative());
     $this->assertTrue($body->isHtml());
     // Only HTML
     $body = new Body($html);
     $this->assertEquals($html, $body->getMain());
     $this->assertTrue($body->isHtml());
     // Only plaintext
     $body = new Body($text);
     $this->assertEquals($text, $body->getMain());
     $this->assertFalse($body->isHtml());
 }