Issue #3458975 by longwave, quietone: GenerateThemeTest::testContribStarterkitDevSnapshotWithGitNotInstalled fails on sqlite
(cherry picked from commit a878833e34
)
merge-requests/9004/head
parent
1a97c700f1
commit
34e0302e57
|
@ -270,6 +270,7 @@ YAML
|
||||||
// not found. Note that we run our tests using process isolation, so we do
|
// not found. Note that we run our tests using process isolation, so we do
|
||||||
// not need to restore the PATH when we are done.
|
// not need to restore the PATH when we are done.
|
||||||
$unavailableGitPath = $this->getWorkspaceDirectory() . '/bin';
|
$unavailableGitPath = $this->getWorkspaceDirectory() . '/bin';
|
||||||
|
putenv('PATH=' . $unavailableGitPath . ':' . getenv('PATH'));
|
||||||
mkdir($unavailableGitPath);
|
mkdir($unavailableGitPath);
|
||||||
$bash = <<<SH
|
$bash = <<<SH
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
@ -279,18 +280,14 @@ SH;
|
||||||
file_put_contents($unavailableGitPath . '/git', $bash);
|
file_put_contents($unavailableGitPath . '/git', $bash);
|
||||||
chmod($unavailableGitPath . '/git', 0755);
|
chmod($unavailableGitPath . '/git', 0755);
|
||||||
// Confirm that 'git' is no longer available.
|
// Confirm that 'git' is no longer available.
|
||||||
$env = [
|
$process = new Process(['git', '--help']);
|
||||||
'PATH' => $unavailableGitPath . ':' . getenv('PATH'),
|
|
||||||
'COLUMNS' => 80,
|
|
||||||
];
|
|
||||||
$process = new Process([
|
|
||||||
'git',
|
|
||||||
'--help',
|
|
||||||
], NULL, $env);
|
|
||||||
$process->run();
|
$process->run();
|
||||||
$this->assertEquals(127, $process->getExitCode(), 'Fake git used by process.');
|
$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();
|
$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->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);
|
$this->assertSame(1, $result);
|
||||||
|
|
Loading…
Reference in New Issue