Example #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);
 }
Example #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);
 }
Example #3
0
 public function case_get_content()
 {
     $this->given($text = 'foobar', $content = new SUT($text))->when($result = $content->getFormattedContent(false))->then->string($result)->isEqualTo('foobar')->given($text = 'fôòbār', $content = new SUT($text))->when($result = $content->getFormattedContent(false))->then->string($result)->isEqualTo('f=C3=B4=C3=B2b=C4=81r');
 }