You are here

public function QuickStartTestBase::installQuickStart in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/BuildTests/QuickStart/QuickStartTestBase.php \Drupal\BuildTests\QuickStart\QuickStartTestBase::installQuickStart()
  2. 9 core/tests/Drupal/BuildTests/QuickStart/QuickStartTestBase.php \Drupal\BuildTests\QuickStart\QuickStartTestBase::installQuickStart()

Install a Drupal site using the quick start feature.

Parameters

string $profile: Drupal profile to install.

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

2 calls to QuickStartTestBase::installQuickStart()
GenerateThemeTest::test in core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php
Tests the generate-theme command.
HtRouterTest::testHtRouter in core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php
@covers ::instantiateServer

File

core/tests/Drupal/BuildTests/QuickStart/QuickStartTestBase.php, line 36

Class

QuickStartTestBase
Helper methods for using the quickstart feature of Drupal.

Namespace

Drupal\BuildTests\QuickStart

Code

public function installQuickStart($profile, $working_dir = NULL) {
  $php_finder = new PhpExecutableFinder();
  $install_process = $this
    ->executeCommand($php_finder
    ->find() . ' ./core/scripts/drupal install ' . $profile, $working_dir);
  $this
    ->assertCommandOutputContains('Username:');
  preg_match('/Username: (.+)\\vPassword: (.+)/', $install_process
    ->getOutput(), $matches);
  $this
    ->assertNotEmpty($this->adminUsername = $matches[1]);
  $this
    ->assertNotEmpty($this->adminPassword = $matches[2]);
}