minor #26150 [Process] fix test case (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Process] fix test case

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

d317496 [Process] fix test case
This commit is contained in:
Nicolas Grekas 2018-02-12 15:54:24 +01:00
commit 72183106cd
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ class PhpExecutableFinder
}
}
if (is_executable($php = PHP_BINDIR.'/php'.('\\' === DIRECTORY_SEPARATOR ? '.exe' : ''))) {
if (is_executable($php = PHP_BINDIR.('\\' === DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) {
return $php;
}

View File

@ -94,7 +94,7 @@ class PhpExecutableFinderTest extends TestCase
//TODO maybe php executable is custom or even Windows
if ('\\' === DIRECTORY_SEPARATOR) {
$this->assertTrue(is_executable($current));
$this->assertTrue((bool) preg_match('/'.addslashes(DIRECTORY_SEPARATOR).'php\.(exe|bat|cmd|com)$/i', $current), '::find() returns the executable PHP with suffixes');
$this->assertRegExp('/\\\\php\.(exe|bat|cmd|com)$/i', $current, '::find() returns the executable PHP with suffixes');
}
}
}