Skip to content

Commit 576f802

Browse files
committed
[Process] PhpExecutableFinder: add regression test
1 parent 4e1fffe commit 576f802

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/Symfony/Component/Process/Tests/PhpExecutableFinderTest.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,27 @@ public function testFindWithPhpPath()
4343
}
4444

4545
/**
46-
* tests find() with the env var PHP_PATH.
46+
* tests find() with the constant PHP_BINARY.
47+
*
48+
* @requires PHP 5.4
49+
*/
50+
public function testFind()
51+
{
52+
if (defined('HHVM_VERSION')) {
53+
$this->markTestSkipped('Should not be executed in HHVM context.');
54+
}
55+
56+
$f = new PhpExecutableFinder();
57+
58+
$current = PHP_BINARY;
59+
$args = 'phpdbg' === PHP_SAPI ? ' -qrr' : '';
60+
61+
$this->assertEquals($current.$args, $f->find(), '::find() returns the executable PHP');
62+
$this->assertEquals($current, $f->find(false), '::find() returns the executable PHP');
63+
}
64+
65+
/**
66+
* tests find() with the env var / constant PHP_BINARY with HHVM.
4767
*/
4868
public function testFindWithHHVM()
4969
{

0 commit comments

Comments
 (0)