Пример #1
0
 /**
  * @param string        $className
  * @param FileInterface $file
  * @return DefinitionInterface[]
  */
 private function collectDefinitionsForClass(string $className, FileInterface $file) : array
 {
     $this->classLoader->loadClass($className, $file);
     if ($this->types) {
         $definitions = [];
         if (in_array(Constants::TEST_TYPE_METHOD, $this->types)) {
             $definitions = array_merge($definitions, $this->collectMethodDefinitionsForClass($className, $file));
         }
         if (in_array(Constants::TEST_TYPE_DOC_COMMENT, $this->types)) {
             $definitions = array_merge($definitions, $this->collectCodeDefinitionsForClass($className, $file));
         }
         return $definitions;
     }
     return array_merge($this->collectMethodDefinitionsForClass($className, $file), $this->collectCodeDefinitionsForClass($className, $file));
 }
Пример #2
0
 /**
  * @param DefinitionInterface $definition
  */
 private function prepareTestRunnerForDefinition(DefinitionInterface $definition)
 {
     if ($definition->getClassName()) {
         $this->classLoader->loadClass($definition->getClassName(), $definition->getFile());
     }
 }