From 34e0302e5789914d22538346bafcfc2f3e4f7848 Mon Sep 17 00:00:00 2001 From: catch <6915-catch@users.noreply.drupalcode.org> Date: Sun, 28 Jul 2024 09:15:30 +0900 Subject: [PATCH] Issue #3458975 by longwave, quietone: GenerateThemeTest::testContribStarterkitDevSnapshotWithGitNotInstalled fails on sqlite (cherry picked from commit a878833e34c7c8fb53b4b6fdc9fd578b29376608) --- .../BuildTests/Command/GenerateThemeTest.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php b/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php index 930f07e7edc..e4f7c40f200 100644 --- a/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php +++ b/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php @@ -270,6 +270,7 @@ YAML // not found. Note that we run our tests using process isolation, so we do // not need to restore the PATH when we are done. $unavailableGitPath = $this->getWorkspaceDirectory() . '/bin'; + putenv('PATH=' . $unavailableGitPath . ':' . getenv('PATH')); mkdir($unavailableGitPath); $bash = << $unavailableGitPath . ':' . getenv('PATH'), - 'COLUMNS' => 80, - ]; - $process = new Process([ - 'git', - '--help', - ], NULL, $env); + $process = new Process(['git', '--help']); $process->run(); $this->assertEquals(127, $process->getExitCode(), 'Fake git used by process.'); - $process = $this->generateThemeFromStarterkit($env); + $process = $this->generateThemeFromStarterkit([ + 'PATH' => getenv('PATH'), + 'COLUMNS' => 80, + ]); $result = $process->run(); $this->assertEquals("[ERROR] The source theme starterkit_theme has a development version number \n (7.x-dev). Determining a specific commit is not possible because git is\n not installed. Either install git or use a tagged release to generate a\n theme.", trim($process->getErrorOutput()), $process->getErrorOutput()); $this->assertSame(1, $result);