10000 Fix issue described in #11421 by jess-sol · Pull Request #11425 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix issue described in #11421 #11425

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 3 commits into from
Jul 25, 2014
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[Process] Add test to verify fix for issue #11421
  • Loading branch information
Ben committed Jul 19, 2014
commit 9f4313cf6f550d829e761e1add5ee8f74f5861a6
21 changes: 21 additions & 0 deletions src/Symfony/Component/Process/Tests/ExecutableFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,27 @@ public function testFindWithOpenBaseDir()
$this->assertSamePath(PHP_BINARY, $result);
}

public function testFindProcessInOpenBasedir()
{
if (ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}

if (!defined('PHP_BINARY')) {
$this->markTestSkipped('Requires the PHP_BINARY constant');
}

$execPath = __DIR__.DIRECTORY_SEPARATOR.'SignalListener.php';
Copy link
Member

Choose a reason for hiding this comment

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

You can use a / here instead of DIRECTORY_SEPARATOR


$this->setPath('');
ini_set('open_basedir', PHP_BINARY.PATH_SEPARATOR.'/');

$finder = new ExecutableFinder;
Copy link
Member

Choose a reason for hiding this comment

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

missing () after the class name.

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

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

private function assertSamePath($expected, $tested)
{
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
Expand Down
0