Esempio n. 1
0
 /**
  * Returns an instance of the given Test Runner class
  *
  * @param string $testRunnerClass
  * @return TestRunnerInterface
  */
 public function create(string $testRunnerClass)
 {
     $testRunner = $this->objectManager->get($testRunnerClass, $this->classLoader, $this->objectManager, $this->environment, $this->printer, $this->exceptionPrinter, $this->eventDispatcher);
     if ($testRunner instanceof TestRunnerInterface) {
         return $testRunner;
     }
     throw new ClassException('Test Runner must implement ' . TestRunnerInterface::class);
 }
Esempio n. 2
0
 /**
  * Include the custom bootstrap file
  *
  * @param string $bootstrapFile
  */
 private function prepareCustomBootstrapAndAutoloading(string $bootstrapFile)
 {
     /** @var Finder $autoloadFinder */
     $autoloadFinder = $this->objectManager->get(Finder::class);
     $projectAutoloaderPath = $autoloadFinder->find(getcwd());
     if ($projectAutoloaderPath !== '') {
         require_once $projectAutoloaderPath;
     }
     // The variable will be exported to the bootstrap file
     $eventDispatcher = $this->eventDispatcher;
     if ($bootstrapFile) {
         require_once $bootstrapFile;
     }
     unset($eventDispatcher);
 }