예제 #1
0
파일: testedClass.php 프로젝트: atoum/atoum
 public function setWithTest(atoum\test $test)
 {
     parent::setWith($test->getTestedClassName());
     return parent::setWithTest($test);
 }
예제 #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);
 }