function RecipeTestTrait::runDrupalCommand

Runs the `core/scripts/drupal` script with the given arguments.

Parameters

string[] $arguments: The arguments and options to pass to the script.

Return value

\Symfony\Component\Process\Process The started process.

3 calls to RecipeTestTrait::runDrupalCommand()
ContentExportTest::testExportContent in core/tests/Drupal/FunctionalTests/DefaultContent/ContentExportTest.php
Ensures that all imported content can be exported properly.
ContentExportTest::testExportedPasswordIsPreserved in core/tests/Drupal/FunctionalTests/DefaultContent/ContentExportTest.php
Tests that an exported user account can be logged in with after import.
RecipeTestTrait::applyRecipe in core/tests/Drupal/FunctionalTests/Core/Recipe/RecipeTestTrait.php
Applies a recipe to the site.

File

core/tests/Drupal/FunctionalTests/Core/Recipe/RecipeTestTrait.php, line 94

Class

RecipeTestTrait
Contains helper methods for interacting with recipes in functional tests.

Namespace

Drupal\FunctionalTests\Core\Recipe

Code

protected function runDrupalCommand(array $arguments) : Process {
  assert($this instanceof BrowserTestBase);
  array_unshift($arguments, (new PhpExecutableFinder())->find(), 'core/scripts/drupal');
  $process = (new Process($arguments))->setWorkingDirectory($this->getDrupalRoot())
    ->setEnv([
    'DRUPAL_DEV_SITE_PATH' => $this->siteDirectory,
    // Ensure that the command boots Drupal into a state where it knows it's
    // a test site.
    // @see drupal_valid_test_ua()
'HTTP_USER_AGENT' => drupal_generate_test_ua($this->databasePrefix),
  ])
    ->setTimeout(500);
  $process->run();
  return $process;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.