Issue #3020550 by catch: Passing commands as a string to Process is deprecated in Symfony 4
parent
96ef995291
commit
b4297ade9e
|
@ -85,7 +85,15 @@ class QuickStartTest extends TestCase {
|
||||||
public function testQuickStartCommand() {
|
public function testQuickStartCommand() {
|
||||||
// Install a site using the standard profile to ensure the one time login
|
// Install a site using the standard profile to ensure the one time login
|
||||||
// link generation works.
|
// link generation works.
|
||||||
$install_command = "{$this->php} core/scripts/drupal quick-start standard --site-name='Test site {$this->testDb->getDatabasePrefix()}' --suppress-login";
|
|
||||||
|
$install_command = [
|
||||||
|
$this->php,
|
||||||
|
'core/scripts/drupal',
|
||||||
|
'quick-start',
|
||||||
|
'standard',
|
||||||
|
"--site-name='Test site {$this->testDb->getDatabasePrefix()}'",
|
||||||
|
'--suppress-login',
|
||||||
|
];
|
||||||
$process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$process->inheritEnvironmentVariables();
|
$process->inheritEnvironmentVariables();
|
||||||
$process->setTimeout(500);
|
$process->setTimeout(500);
|
||||||
|
@ -129,7 +137,13 @@ class QuickStartTest extends TestCase {
|
||||||
*/
|
*/
|
||||||
public function testQuickStartInstallAndServerCommands() {
|
public function testQuickStartInstallAndServerCommands() {
|
||||||
// Install a site.
|
// Install a site.
|
||||||
$install_command = "{$this->php} core/scripts/drupal install testing --site-name='Test site {$this->testDb->getDatabasePrefix()}'";
|
$install_command = [
|
||||||
|
$this->php,
|
||||||
|
'core/scripts/drupal',
|
||||||
|
'install',
|
||||||
|
'testing',
|
||||||
|
"--site-name='Test site {$this->testDb->getDatabasePrefix()}'",
|
||||||
|
];
|
||||||
$install_process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$install_process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$install_process->inheritEnvironmentVariables();
|
$install_process->inheritEnvironmentVariables();
|
||||||
$install_process->setTimeout(500);
|
$install_process->setTimeout(500);
|
||||||
|
@ -139,7 +153,12 @@ class QuickStartTest extends TestCase {
|
||||||
$this->assertSame(0, $result);
|
$this->assertSame(0, $result);
|
||||||
|
|
||||||
// Run the PHP built-in webserver.
|
// Run the PHP built-in webserver.
|
||||||
$server_command = "{$this->php} core/scripts/drupal server --suppress-login";
|
$server_command = [
|
||||||
|
$this->php,
|
||||||
|
'core/scripts/drupal',
|
||||||
|
'server',
|
||||||
|
'--suppress-login',
|
||||||
|
];
|
||||||
$server_process = new Process($server_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$server_process = new Process($server_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$server_process->inheritEnvironmentVariables();
|
$server_process->inheritEnvironmentVariables();
|
||||||
$server_process->start();
|
$server_process->start();
|
||||||
|
@ -173,7 +192,13 @@ class QuickStartTest extends TestCase {
|
||||||
$this->assertContains('Test site ' . $this->testDb->getDatabasePrefix(), $content);
|
$this->assertContains('Test site ' . $this->testDb->getDatabasePrefix(), $content);
|
||||||
|
|
||||||
// Try to re-install over the top of an existing site.
|
// Try to re-install over the top of an existing site.
|
||||||
$install_command = "{$this->php} core/scripts/drupal install testing --site-name='Test another site {$this->testDb->getDatabasePrefix()}'";
|
$install_command = [
|
||||||
|
$this->php,
|
||||||
|
'core/scripts/drupal',
|
||||||
|
'install',
|
||||||
|
'testing',
|
||||||
|
"--site-name='Test another site {$this->testDb->getDatabasePrefix()}'",
|
||||||
|
];
|
||||||
$install_process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$install_process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$install_process->inheritEnvironmentVariables();
|
$install_process->inheritEnvironmentVariables();
|
||||||
$install_process->setTimeout(500);
|
$install_process->setTimeout(500);
|
||||||
|
@ -196,7 +221,13 @@ class QuickStartTest extends TestCase {
|
||||||
public function testQuickStartCommandProfileValidation() {
|
public function testQuickStartCommandProfileValidation() {
|
||||||
// Install a site using the standard profile to ensure the one time login
|
// Install a site using the standard profile to ensure the one time login
|
||||||
// link generation works.
|
// link generation works.
|
||||||
$install_command = "{$this->php} core/scripts/drupal quick-start umami --site-name='Test site {$this->testDb->getDatabasePrefix()}' --suppress-login";
|
$install_command = [
|
||||||
|
$this->php,
|
||||||
|
'core/scripts/drupal',
|
||||||
|
'quick-start',
|
||||||
|
'umami',
|
||||||
|
"--site-name='Test site {$this->testDb->getDatabasePrefix()}' --suppress-login",
|
||||||
|
];
|
||||||
$process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$process->inheritEnvironmentVariables();
|
$process->inheritEnvironmentVariables();
|
||||||
$process->run();
|
$process->run();
|
||||||
|
@ -207,7 +238,12 @@ class QuickStartTest extends TestCase {
|
||||||
* Tests the server command when there is no installation.
|
* Tests the server command when there is no installation.
|
||||||
*/
|
*/
|
||||||
public function testServerWithNoInstall() {
|
public function testServerWithNoInstall() {
|
||||||
$server_command = "{$this->php} core/scripts/drupal server --suppress-login";
|
$server_command = [
|
||||||
|
$this->php,
|
||||||
|
'core/scripts/drupal',
|
||||||
|
'server',
|
||||||
|
'--suppress-login',
|
||||||
|
];
|
||||||
$server_process = new Process($server_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$server_process = new Process($server_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$server_process->inheritEnvironmentVariables();
|
$server_process->inheritEnvironmentVariables();
|
||||||
$server_process->run();
|
$server_process->run();
|
||||||
|
|
Loading…
Reference in New Issue