8000 minor #51297 [Process] fix tests (nicolas-grekas) · symfony/symfony@b4d215c · GitHub
[go: up one dir, main page]

Skip to content

Commit b4d215c

Browse files
minor #51297 [Process] fix tests (nicolas-grekas)
This PR was merged into the 6.4 branch. Discussion ---------- [Process] fix tests | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - - `testFindProcessInOpenBasedir` is a duplicate of `testFindWithOpenBaseDir` - `testFindWithOpenBaseDir` currently expects that we search open_basedir instead of PATH when the setting is set, but this doesn't really make sense, and #47422 removed this behavior - `PhpSubprocessTest::testSubprocess` expects a php that defaults to memory_limit=-1, which is not the case currently for the sigchild-enabled binary Commits ------- 4ca4417 [Process] fix tests
2 parents 6682baf + 4ca4417 commit b4d215c

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,6 @@ jobs:
237237
tar -xjf php-8.1.2-pcntl-sigchild.tar.bz2
238238
cd ..
239239
240+
mkdir -p /opt/php/lib
241+
echo memory_limit=-1 > /opt/php/lib/php.ini
240242
./build/php/bin/php ./phpunit --colors=always src/Symfony/Component/Process

src/Symfony/Component/Process/Tests/ExecutableFinderTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public function testFindWithOpenBaseDir()
9898
$this->markTestSkipped('Cannot test when open_basedir is set');
9999
}
100100

101+
putenv('PATH='.\dirname(\PHP_BINARY));
101102
$this->iniSet('open_basedir', \dirname(\PHP_BINARY).\PATH_SEPARATOR.'/');
102103

103104
$finder = new ExecutableFinder();
@@ -106,26 +107,6 @@ public function testFindWithOpenBaseDir()
106107
$this->assertSamePath(\PHP_BINARY, $result);
107108
}
108109

109-
/**
110-
* @runInSeparateProcess
111-
*/
112-
public function testFindProcessInOpenBasedir()
113-
{
114-
if (\ini_get('open_basedir')) {
115-
$this->markTestSkipped('Cannot test when open_basedir is set');
116-
}
117-
if ('\\' === \DIRECTORY_SEPARATOR) {
118-
$this->markTestSkipped('Cannot run test on windows');
119-
}
120-
121-
$this->iniSet('open_basedir', \PHP_BINARY.\PATH_SEPARATOR.'/');
122-
123-
$finder = new ExecutableFinder();
124-
$result = $finder->find($this->getPhpBinaryName(), false);
125-
126-
$this->assertSamePath(\PHP_BINARY, $result);
127-
}
128-
129110
public function testFindBatchExecutableOnWindows()
130111
{
131112
if (\ini_get('open_basedir')) {

0 commit comments

Comments
 (0)
0