[Process] Add test to verify fix for issue #11421

This commit is contained in:
Ben 2014-07-19 17:48:53 -06:00
parent 02eb765a9c
commit 9f4313cf6f
1 changed files with 21 additions and 0 deletions

View File

@ -110,6 +110,27 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase
$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';
$this->setPath('');
ini_set('open_basedir', PHP_BINARY.PATH_SEPARATOR.'/');
$finder = new ExecutableFinder;
$result = $finder->find($this->getPhpBinaryName(), false);
$this->assertSamePath(PHP_BINARY, $result);
}
private function assertSamePath($expected, $tested)
{
if (defined('PHP_WINDOWS_VERSION_BUILD')) {