Ejemplo n.º 1
0
 public function prepare()
 {
     $phpunitConfiguration = $this->phpunitConfigurationFactory->create();
     if (!is_null($phpunitConfiguration)) {
         $this->earlyConfigure($phpunitConfiguration);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function build(array $options)
 {
     $phpunitConfiguration = $this->phpunitConfigurationFactory->create();
     if (!is_null($phpunitConfiguration)) {
         $options[] = '--phpunit-config=' . escapeshellarg($phpunitConfiguration->getFilename());
     }
     return $options;
 }
 /**
  * @param string $testCase
  * @since Method available since Release 2.11.0
  */
 public function collectTestCase($testCase)
 {
     $testClass = new \ReflectionClass($testCase);
     if ($testClass->isAbstract()) {
         return;
     }
     $suiteMethod = $this->findSuiteMethod($testClass);
     if (is_null($suiteMethod)) {
         $testSuite = new PHPUnitGroupFilterTestSuite($testClass, $this->phpunitConfigurationFactory->create());
     } else {
         $testSuite = $suiteMethod->invoke(null, $testClass->getName());
     }
     if (!(count($testSuite->tests()) == 1 && $testSuite->testAt(0) instanceof \PHPUnit_Framework_Warning)) {
         if ($this->testTargetRepository->testsOnlySpecifiedMethods()) {
             $this->filterTests($testSuite, self::$FILTER_METHOD);
         } elseif ($this->testTargetRepository->testsOnlySpecifiedClasses()) {
             $this->filterTests($testSuite, self::$FILTER_CLASS);
         }
     }
     if (count($testSuite) > 0) {
         $this->suite->addTest($testSuite);
     }
 }
Ejemplo n.º 4
0
 /**
  * @param \Stagehand\TestRunner\Runner\PHPUnitRunner\Printer\ResultPrinter $printer
  * @param \PHPUnit_Framework_TestResult                                    $testResult
  *
  * @return array
  *
  * @since Method available since Release 3.3.0
  */
 protected function createArguments(ResultPrinter $printer, \PHPUnit_Framework_TestResult $testResult)
 {
     $arguments = array();
     $arguments['printer'] = $printer;
     Stream::register();
     $arguments['listeners'] = array(new TestDoxPrinter(fopen('testdox://' . spl_object_hash($testResult), 'w'), $this->terminal, $this->prettifier()));
     if ($this->hasJUnitXMLFile()) {
         $arguments['listeners'][] = new JUnitXMLPrinter(null, $this->createJUnitXMLWriter(), $this->testTargetRepository);
     }
     if ($this->shouldStopOnFailure()) {
         $arguments['stopOnFailure'] = true;
         $arguments['stopOnError'] = true;
     }
     $phpunitConfiguration = $this->phpunitConfigurationFactory->create();
     if (!is_null($phpunitConfiguration)) {
         $arguments['configuration'] = $phpunitConfiguration->getFileName();
     }
     return $arguments;
 }