ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
Symfony\Component\Process\Tests\PhpExecutableFinderTest Class Reference
+ Inheritance diagram for Symfony\Component\Process\Tests\PhpExecutableFinderTest:
+ Collaboration diagram for Symfony\Component\Process\Tests\PhpExecutableFinderTest:

Public Member Functions

 testFind ()
 tests find() with the constant PHP_BINARY. More...
 
 testFindWithHHVM ()
 tests find() with the env var / constant PHP_BINARY with HHVM. More...
 
 testFindArguments ()
 tests find() with the env var PHP_PATH. More...
 

Detailed Description

Author
Robert Schönthal seros.nosp@m.cho@.nosp@m.googl.nosp@m.emai.nosp@m.l.com

Definition at line 19 of file PhpExecutableFinderTest.php.

Member Function Documentation

◆ testFind()

Symfony\Component\Process\Tests\PhpExecutableFinderTest::testFind ( )

tests find() with the constant PHP_BINARY.

Definition at line 24 of file PhpExecutableFinderTest.php.

References defined.

25  {
26  if (defined('HHVM_VERSION')) {
27  $this->markTestSkipped('Should not be executed in HHVM context.');
28  }
29 
30  $f = new PhpExecutableFinder();
31 
32  $current = PHP_BINARY;
33  $args = 'phpdbg' === PHP_SAPI ? ' -qrr' : '';
34 
35  $this->assertEquals($current.$args, $f->find(), '::find() returns the executable PHP');
36  $this->assertEquals($current, $f->find(false), '::find() returns the executable PHP');
37  }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

◆ testFindArguments()

Symfony\Component\Process\Tests\PhpExecutableFinderTest::testFindArguments ( )

tests find() with the env var PHP_PATH.

Definition at line 59 of file PhpExecutableFinderTest.php.

References array, and defined.

60  {
61  $f = new PhpExecutableFinder();
62 
63  if (defined('HHVM_VERSION')) {
64  $this->assertEquals($f->findArguments(), array('--php'), '::findArguments() returns HHVM arguments');
65  } elseif ('phpdbg' === PHP_SAPI) {
66  $this->assertEquals($f->findArguments(), array('-qrr'), '::findArguments() returns phpdbg arguments');
67  } else {
68  $this->assertEquals($f->findArguments(), array(), '::findArguments() returns no arguments');
69  }
70  }
Create styles array
The data for the language used.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

◆ testFindWithHHVM()

Symfony\Component\Process\Tests\PhpExecutableFinderTest::testFindWithHHVM ( )

tests find() with the env var / constant PHP_BINARY with HHVM.

Definition at line 42 of file PhpExecutableFinderTest.php.

References defined.

43  {
44  if (!defined('HHVM_VERSION')) {
45  $this->markTestSkipped('Should be executed in HHVM context.');
46  }
47 
48  $f = new PhpExecutableFinder();
49 
50  $current = getenv('PHP_BINARY') ?: PHP_BINARY;
51 
52  $this->assertEquals($current.' --php', $f->find(), '::find() returns the executable PHP');
53  $this->assertEquals($current, $f->find(false), '::find() returns the executable PHP');
54  }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

The documentation for this class was generated from the following file: