[Process] PhpExecutableFinder: add regression test

This commit is contained in:
ogizanagi 2015-11-19 23:03:24 +01:00
parent 4e1fffe016
commit 576f802917
1 changed files with 21 additions and 1 deletions

View File

@ -43,7 +43,27 @@ class PhpExecutableFinderTest extends \PHPUnit_Framework_TestCase
}
/**
* tests find() with the env var PHP_PATH.
* tests find() with the constant PHP_BINARY.
*
* @requires PHP 5.4
*/
public function testFind()
{
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Should not be executed in HHVM context.');
}
$f = new PhpExecutableFinder();
$current = PHP_BINARY;
$args = 'phpdbg' === PHP_SAPI ? ' -qrr' : '';
$this->assertEquals($current.$args, $f->find(), '::find() returns the executable PHP');
$this->assertEquals($current, $f->find(false), '::find() returns the executable PHP');
}
/**
* tests find() with the env var / constant PHP_BINARY with HHVM.
*/
public function testFindWithHHVM()
{