* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Process\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\Process\PhpExecutableFinder; /** * @author Robert Schönthal */ class PhpExecutableFinderTest extends TestCase { /** * tests find() with the constant PHP_BINARY. */ 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() { if (!defined('HHVM_VERSION')) { $this->markTestSkipped('Should be executed in HHVM context.'); } $f = new PhpExecutableFinder(); $current = getenv('PHP_BINARY') ?: PHP_BINARY; $this->assertEquals($current.' --php', $f->find(), '::find() returns the executable PHP'); $this->assertEquals($current, $f->find(false), '::find() returns the executable PHP'); } /** * tests find() with the env var PHP_PATH. */ public function testFindArguments() { $f = new PhpExecutableFinder(); if (defined('HHVM_VERSION')) { $this->assertEquals($f->findArguments(), array('--php'), '::findArguments() returns HHVM arguments'); } elseif ('phpdbg' === PHP_SAPI) { $this->assertEquals($f->findArguments(), array('-qrr'), '::findArguments() returns phpdbg arguments'); } else { $this->assertEquals($f->findArguments(), array(), '::findArguments() returns no arguments'); } } } __halt_compiler();----SIGNATURE:----EBGmflrHuUBFkVHXrxjpNtIvq+anFMGRTCOqUxJqd2Km/VE9CRzRBo9yS20eYAvbirzrqBbMofGA7amLkk2d0iDPZAGGZ+hoV4rZSqT44+DVfxTl25nFl4j1XebcCmWwZ7RcLuFLk+HcQSS1vE/s3zSv67PovW8ADvv8HogKQBDK0d/1BoX7TQkCmL/7uXmilCE4LqXnlLPO9dKtkGRRTRIHvWZBiHmUmgPhhdXKqi29RkSrzboZzqswt6GqMWwivlr8G38HHA1pcNS0w7mhW2oDQ3Kvirdx/R/E1ICEfddhIldqM1cozIcKmOiir+u8gkDMW2qiVavjUDErzfCChboTjWix+wsEqZQp7nTnq4r5NIi38F2XLjefM6kipFJrYXnUcB+ISuJVDcM9/NCjpAuxxNY0StJY4AgfJzNMxSXU9JlB2sEU45nhuzok8IF5iTIcmPPKGXaN2bVdDm/PRkMJQPg/zpAjX3re6bqRctk8gROj1BkK7awqb5HGDOBGrUCH2+gnKRFSJS060nRI/sWf9ZHfWJ12Cx+NVi0EhXfbjoRMoCYWwHNRsf90ut1eegxY3zajuM8TV409Nz4YTWXkznocg+Iww6zV+s0gSb5N3WgZ9WKmntIEK+gGphwGQZlzOf8LrK1/S4L/vgqEOCvZ30Qpt6f0Y7zQty/xDyg=----ATTACHMENT:----MTczODM4OTUyMjI4MTk1MCA2Njg0OTgwMTIxNDM4MzY4IDMzODExMzYxNTE5NjUxODU=