Beispiel #1
0
 public function testSetWith()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->assert('It is impossible to set asserter with something else than an exception')->exception(function () use(&$line, $asserter, &$value) {
         $line = __LINE__;
         $asserter->setWith($value = uniqid());
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s is not an exception'), $asserter->getTypeOf($value)))->string($asserter->getValue())->isEqualTo($value)->assert('The asserter was returned when it set with an exception')->object($asserter->setWith($value = new \exception()))->isIdenticalTo($asserter)->exception($asserter->getValue())->isIdenticalTo($value);
 }