12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
-
-
-
- namespace Symfony\Tests\Component\Process;
-
- use Symfony\Component\Process\PhpExecutableFinder;
-
-
- class PhpExecutableFinderTest extends \PHPUnit_Framework_TestCase
- {
-
-
- public function testFindWithPHP_PATH()
- {
- $f = new PhpExecutableFinder();
-
- $current = $f->find();
-
-
- putenv('PHP_PATH=/not/executable/php');
- $this->assertFalse($f->find(), '::find() returns false for not executable php');
-
-
- putenv('PHP_PATH='.$current);
- $this->assertEquals($f->find(), $current, '::find() returns the executable php');
- }
-
-
-
- public function testFindWithSuffix()
- {
- putenv('PHP_PATH=');
- putenv('PHP_PEAR_PHP_BIN=');
- $f = new PhpExecutableFinder();
-
- $current = $f->find();
-
-
- if (false === strstr(PHP_OS, 'WIN')) {
- $this->assertEquals($current, PHP_BINDIR.DIRECTORY_SEPARATOR.'php', '::find() returns the executable php with suffixes');
- }
- }
-
-
-
- public function testFindWithPHP_PEAR_PHP_BIN()
- {
-
-
-
- $this->markTestIncomplete();
-
- $f = new PhpExecutableFinder();
-
- $current = $f->find();
-
-
- putenv('PHP_PEAR_PHP_BIN=/not/executable/php');
- $this->assertFalse($f->find(), '::find() returns false for not executable php');
-
-
- putenv('PHP_PEAR_PHP_BIN='.$current);
- $this->assertEquals($f->find(), $current, '::find() returns the executable php');
- }
- }
|