public function PhpExecutableFinderTest::testFindWithPhpPath

tests find() with the env var PHP_PATH

File

drupal/core/vendor/symfony/process/Symfony/Component/Process/Tests/PhpExecutableFinderTest.php, line 24

Class

PhpExecutableFinderTest
@author Robert Schönthal <seroscho@googlemail.com>

Namespace

Symfony\Component\Process\Tests

Code

public function testFindWithPhpPath() {
  if (defined('PHP_BINARY')) {
    $this
      ->markTestSkipped('The PHP binary is easily available as of PHP 5.4');
  }
  $f = new PhpExecutableFinder();
  $current = $f
    ->find();

  //not executable PHP_PATH
  putenv('PHP_PATH=/not/executable/php');
  $this
    ->assertFalse($f
    ->find(), '::find() returns false for not executable php');

  //executable PHP_PATH
  putenv('PHP_PATH=' . $current);
  $this
    ->assertEquals($f
    ->find(), $current, '::find() returns the executable php');
}