Skip to content

[Process] fix tests #51297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,6 @@ jobs:
tar -xjf php-8.1.2-pcntl-sigchild.tar.bz2
cd ..

mkdir -p /opt/php/lib
echo memory_limit=-1 > /opt/php/lib/php.ini
./build/php/bin/php ./phpunit --colors=always src/Symfony/Component/Process
21 changes: 1 addition & 20 deletions src/Symfony/Component/Process/Tests/ExecutableFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public function testFindWithOpenBaseDir()
$this->markTestSkipped('Cannot test when open_basedir is set');
}

putenv('PATH='.\dirname(\PHP_BINARY));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be restored to previous value at end of the test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$this->iniSet('open_basedir', \dirname(\PHP_BINARY).\PATH_SEPARATOR.'/');

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

/**
* @runInSeparateProcess
*/
public function testFindProcessInOpenBasedir()
{
if (\ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
if ('\\' === \DIRECTORY_SEPARATOR) {
$this->markTestSkipped('Cannot run test on windows');
}

$this->iniSet('open_basedir', \PHP_BINARY.\PATH_SEPARATOR.'/');

$finder = new ExecutableFinder();
$result = $finder->find($this->getPhpBinaryName(), false);

$this->assertSamePath(\PHP_BINARY, $result);
}

public function testFindBatchExecutableOnWindows()
{
if (\ini_get('open_basedir')) {
Expand Down