You are here

public function ExecutableFinderTest::testFindWithOpenBaseDir in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/process/Tests/ExecutableFinderTest.php \Symfony\Component\Process\Tests\ExecutableFinderTest::testFindWithOpenBaseDir()

File

vendor/symfony/process/Tests/ExecutableFinderTest.php, line 91

Class

ExecutableFinderTest
@author Chris Smith <chris@cs278.org>

Namespace

Symfony\Component\Process\Tests

Code

public function testFindWithOpenBaseDir() {
  if (!defined('PHP_BINARY')) {
    $this
      ->markTestSkipped('Requires the PHP_BINARY constant');
  }
  if ('\\' === DIRECTORY_SEPARATOR) {
    $this
      ->markTestSkipped('Cannot run test on windows');
  }
  if (ini_get('open_basedir')) {
    $this
      ->markTestSkipped('Cannot test when open_basedir is set');
  }
  $this
    ->iniSet('open_basedir', dirname(PHP_BINARY) . (!defined('HHVM_VERSION') ? PATH_SEPARATOR . '/' : ''));
  $finder = new ExecutableFinder();
  $result = $finder
    ->find($this
    ->getPhpBinaryName());
  $this
    ->assertSamePath(PHP_BINARY, $result);
}