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