Exemplo n.º 1
0
 public function setWithTest(atoum\test $test)
 {
     parent::setWith($test->getTestedClassName());
     return parent::setWithTest($test);
 }
Exemplo n.º 2
0
 public function testHasMethod()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->exception(function () use($asserter) {
         $asserter->hasMethod(uniqid());
     })->isInstanceOf('logicException')->hasMessage('Class is undefined')->if($class = uniqid())->and($method = uniqid())->and($reflectionClass = new \mock\reflectionClass($class = uniqid()))->and($reflectionClassController = $reflectionClass->getMockController())->and($reflectionClassController->getName = $class)->and($reflectionClassController->hasMethod = false)->and($asserter->setReflectionClassInjector(function ($class) use($reflectionClass) {
         return $reflectionClass;
     })->setWith($class))->then->exception(function () use($asserter, $method) {
         $asserter->hasMethod($method);
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('Method %s::%s() does not exist'), $class, $method))->if($reflectionClassController->hasMethod = true)->then->object($asserter->hasMethod(uniqid()))->isIdenticalTo($asserter);
 }