示例#1
0
 public function testHasContent()
 {
     $this->if($object = new TestedClass($generator = new asserter\generator()))->and($response = new \mock\Symfony\Component\HttpFoundation\Response())->and($this->calling($response)->getContent = function () use(&$content) {
         return $content;
     })->and($object->setWith($response))->and($content = uniqid())->then->exception(function () use($object, &$value) {
         $object->hasContent($value = uniqid());
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('Content %s is not equal to %s'), $object->getAnalyzer()->getTypeOf($content), $object->getAnalyzer()->getTypeOf($value)))->if($content = uniqid())->then->object($object->hasContent($content))->isIdenticalTo($object);
 }