Esempio n. 1
0
 public function testSetWith()
 {
     $this->if($asserter = new asserters\adapter($generator = new asserter\generator()))->then->assert('Set the asserter with something else than an adapter throw an exception')->exception(function () use($asserter, &$value) {
         $asserter->setWith($value = uniqid());
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s is not a test adapter'), $asserter->getTypeOf($value)))->string($asserter->getAdapter())->isEqualTo($value)->assert('It is possible to set the asserter with an adapter')->object($asserter->setWith($adapter = new test\adapter()))->isIdenticalTo($asserter)->object($asserter->getAdapter())->isIdenticalTo($adapter);
 }