You are here

public function BuildTestBase::executeCommand in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::executeCommand()

Run a command.

Parameters

string $command_line: A command line to run in an isolated process.

string $working_dir: (optional) A working directory relative to the workspace, within which to execute the command. Defaults to the workspace directory.

Return value

\Symfony\Component\Process\Process

6 calls to BuildTestBase::executeCommand()
BuildTestTest::testWorkspace in core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
Ensure that workspaces work.
ComposerProjectTemplatesTest::makeVendorPackage in core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
Creates a test package that points to all the projects in vendor.
ComposerProjectTemplatesTest::testTemplateCreateProject in core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
@dataProvider provideTemplateCreateProject
ComposerValidateTest::testValidateComposer in core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php
@dataProvider provideComposerJson
HtRouterTest::testHtRouter in core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php
@covers ::instantiateServer

... See full list

File

core/tests/Drupal/BuildTests/Framework/BuildTestBase.php, line 321

Class

BuildTestBase
Provides a workspace to test build processes.

Namespace

Drupal\BuildTests\Framework

Code

public function executeCommand($command_line, $working_dir = NULL) {
  $this->commandProcess = new Process($command_line);
  $this->commandProcess
    ->setWorkingDirectory($this
    ->getWorkingPath($working_dir))
    ->setTimeout(300)
    ->setIdleTimeout(300);
  $this->commandProcess
    ->run();
  return $this->commandProcess;
}