phpUnitCommand example

    // functional tests can connect to the database.     putenv('SIMPLETEST_DB=' . Database::getConnectionInfoAsUrl());

    // Setup an environment variable containing the base URL, if it is available.     // This allows functional tests to browse the site under test. When running     // tests via CLI, core/phpunit.xml.dist or core/scripts/run-tests.sh can set     // this variable.     if ($base_url) {
      putenv('SIMPLETEST_BASE_URL=' . $base_url);
      putenv('BROWSERTEST_OUTPUT_DIRECTORY=' . $this->workingDirectory);
    }
    $phpunit_bin = $this->phpUnitCommand();

    $command = [
      $phpunit_bin,
      '--log-junit',
      escapeshellarg($phpunit_file),
    ];

    // Optimized for running a single test.     if (count($unescaped_test_classnames) == 1) {
      $class = new \ReflectionClass($unescaped_test_classnames[0]);
      $command[] = escapeshellarg($class->getFileName());
    }
'line' => '0',
      'file' => $log_path,
    ];
    $this->assertEquals($fail_row$row);
  }

  /** * @covers ::phpUnitCommand */
  public function testPhpUnitCommand() {
    $runner = new PhpUnitTestRunner($this->root, sys_get_temp_dir());
    $this->assertMatchesRegularExpression('/phpunit/', $runner->phpUnitCommand());
  }

  /** * @covers ::xmlLogFilePath */
  public function testXmlLogFilePath() {
    $runner = new PhpUnitTestRunner($this->root, sys_get_temp_dir());
    $this->assertStringEndsWith('phpunit-23.xml', $runner->xmlLogFilePath(23));
  }

  public function providerTestSummarizeResults() {
    
Home | Imprint | This part of the site doesn't use cookies.