mageekguy\atoum\report\fields\runner\coverage\html::getReflectionClass PHP Method

getReflectionClass() public method

public getReflectionClass ( $class )
    public function getReflectionClass($class)
    {
        if ($this->reflectionClassInjector === null) {
            $reflectionClass = new \reflectionClass($class);
        } else {
            $reflectionClass = $this->reflectionClassInjector->__invoke($class);
            if ($reflectionClass instanceof \reflectionClass === false) {
                throw new exceptions\runtime\unexpectedValue('Reflection class injector must return a \\reflectionClass instance');
            }
        }
        return $reflectionClass;
    }

Usage Example

Exemplo n.º 1
0
 public function testGetReflectionClass()
 {
     $this->if($field = new testedClass(uniqid(), uniqid(), uniqid()))->then->object($field->getReflectionClass(__CLASS__))->isInstanceOf('reflectionClass')->string($field->getReflectionClass(__CLASS__)->getName())->isEqualTo(__CLASS__)->if($field->setReflectionClassInjector(function ($class) {
     }))->then->exception(function () use($field) {
         $field->getReflectionClass(uniqid());
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\runtime\\unexpectedValue')->hasMessage('Reflection class injector must return a \\reflectionClass instance');
 }