You are here

public function BuildTestBase::executeCommand in Drupal 9

Same name and namespace in other branches
  1. 8 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

10 calls to BuildTestBase::executeCommand()
BuildTestTest::testWorkspace in core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
Ensure that workspaces work.
ComposerProjectTemplatesTest::assertDrupalVersion in core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
Assert that the VERSION constant in Drupal.php is the expected value.
ComposerProjectTemplatesTest::getCoreStability in core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
Returns the stability of the current core version.
ComposerProjectTemplatesTest::getLowestDependencyStability in core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
Returns the stability of the least stable dependency.
ComposerProjectTemplatesTest::makeVendorPackage in core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
Creates a test package that points to all the projects in vendor.

... See full list

File

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

Class

BuildTestBase
Provides a workspace to test build processes.

Namespace

Drupal\BuildTests\Framework

Code

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