Exemplo n.º 1
0
 public function case_basic()
 {
     $this->given($this->function->microtime = function () use(&$microtime) {
         return $microtime = 42;
     }, $related1 = new CHtml('<strong>foo</strong>'), $related2 = new CText('foo'), $related = new SUT([$related1, $related2]))->when($result = $related->getFormattedContent())->then->string($result)->isEqualTo('content-type: multipart/related; boundary="__bndry-4200f97b27dcfb5905f0c9c7b680920d"' . CRLF . CRLF . '--__bndry-4200f97b27dcfb5905f0c9c7b680920d' . CRLF . $related1->getFormattedContent() . CRLF . '--__bndry-4200f97b27dcfb5905f0c9c7b680920d' . CRLF . $related2->getFormattedContent() . CRLF . '--__bndry-4200f97b27dcfb5905f0c9c7b680920d' . '--' . CRLF);
 }
Exemplo n.º 2
0
 public function case_basic()
 {
     $this->given($this->function->microtime = function () use(&$microtime) {
         return $microtime = 42;
     }, $content1 = new Text('foo'), $content2 = new Html('<strong>foo</strong>'), $alternative = new SUT([$content1, $content2]))->when($result = $alternative->getFormattedContent())->then->string($result)->isEqualTo('content-type: multipart/alternative; boundary="__bndry-3d469222fa3ab341c0d491b98a8aa315"' . CRLF . CRLF . '--__bndry-3d469222fa3ab341c0d491b98a8aa315' . CRLF . $content1->getFormattedContent() . CRLF . '--__bndry-3d469222fa3ab341c0d491b98a8aa315' . CRLF . $content2->getFormattedContent() . CRLF . '--__bndry-3d469222fa3ab341c0d491b98a8aa315' . '--' . CRLF);
 }
Exemplo n.º 3
0
 public function case_content_type()
 {
     $this->given($content = new SUT())->when($result = $content->getHeaders())->then->array($result)->hasKey('content-type')->string($result['content-type'])->isEqualTo('text/html; charset=utf-8');
 }