Exemplo n.º 1
0
 public function testIsAbstract()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->exception(function () use($asserter) {
         $asserter->isAbstract();
     })->isInstanceOf('logicException')->hasMessage('Class is undefined')->if($class = uniqid())->and($mockController = new atoum\mock\controller())->and($mockController->__construct = function () {
     })->and($mockController->getName = function () use($class) {
         return $class;
     })->and($asserter->setReflectionClassInjector(function ($class) use($mockController) {
         return new \mock\reflectionClass($class, $mockController);
     })->setWith($class))->and($mockController->isAbstract = false)->then->exception(function () use($asserter) {
         $asserter->isAbstract();
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('Class %s is not abstract'), $class))->if($mockController->isAbstract = true)->then->object($asserter->isAbstract())->isIdenticalTo($asserter);
 }