PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.5
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.5
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / symfony / process / Tests / PhpExecutableFinderTest.php

PhpExecutableFinderTest.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.5, at vendor/symfony/process/Tests/PhpExecutableFinderTest.php

73 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <[email protected]>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\Process\Tests;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Process\PhpExecutableFinder;
16
17 /**
18 * @author Robert Schönthal <[email protected]>
19 */
20 class PhpExecutableFinderTest extends TestCase
21 {
22 /**
23 * tests find() with the constant PHP_BINARY.
24 */
25 public function testFind()
26 {
27 if (\defined('HHVM_VERSION')) {
28 $this->markTestSkipped('Should not be executed in HHVM context.');
29 }
30
31 $f = new PhpExecutableFinder();
32
33 $current = \PHP_BINARY;
34 $args = 'phpdbg' === \PHP_SAPI ? ' -qrr' : '';
35
36 $this->assertEquals($current.$args, $f->find(), '::find() returns the executable PHP');
37 $this->assertEquals($current, $f->find(false), '::find() returns the executable PHP');
38 }
39
40 /**
41 * tests find() with the env var / constant PHP_BINARY with HHVM.
42 */
43 public function testFindWithHHVM()
44 {
45 if (!\defined('HHVM_VERSION')) {
46 $this->markTestSkipped('Should be executed in HHVM context.');
47 }
48
49 $f = new PhpExecutableFinder();
50
51 $current = getenv('PHP_BINARY') ?: \PHP_BINARY;
52
53 $this->assertEquals($current.' --php', $f->find(), '::find() returns the executable PHP');
54 $this->assertEquals($current, $f->find(false), '::find() returns the executable PHP');
55 }
56
57 /**
58 * tests find() with the env var PHP_PATH.
59 */
60 public function testFindArguments()
61 {
62 $f = new PhpExecutableFinder();
63
64 if (\defined('HHVM_VERSION')) {
65 $this->assertEquals(['--php'], $f->findArguments(), '::findArguments() returns HHVM arguments');
66 } elseif ('phpdbg' === \PHP_SAPI) {
67 $this->assertEquals(['-qrr'], $f->findArguments(), '::findArguments() returns phpdbg arguments');
68 } else {
69 $this->assertEquals([], $f->findArguments(), '::findArguments() returns no arguments');
70 }
71 }
72 }
73