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