Skip to content

Commit 010cf42

Browse files
Merge branch '4.4' into 5.0
* 4.4: (28 commits) bug #34554 [HttpClient] Fix early cleanup of pushed HTTP/2 responses (lyrixx) Fix tests [Console] Fix commands description with numeric namespaces [HttpFoundation] Fixed typo [DI] Skip unknown method calls for factories in check types pass [EventDispatcher] Better error reporting when arguments to dispatch() are swapped improve upgrade instructions for twig.exception_controller configuration [HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4 [Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor [Form] Keep preferred_choices order for choice groups [Debug] work around failing chdir() on Darwin [PhpUnitBridge] Read configuration CLI directive [DI] Missing test on YamlFileLoader Revert "minor #34608 [Process] add tests for php executable finder if file does not exist (ahmedash95)" Simpler example for Apache basic auth workaround [Console] Fix trying to access array offset on value of type int [Config] Remove extra sprintf arg [HttpKernel] fix typo [HttpKernel] Support typehint to deprecated FlattenException in controller Add preview mode support for Html and Serializer error renderers ...
2 parents 3c288a1 + 7244971 commit 010cf42

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bin/simple-phpunit.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@
1414

1515
error_reporting(-1);
1616

17-
$getEnvVar = function ($name, $default = false) {
17+
global $argv, $argc;
18+
$argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
19+
$argc = isset($_SERVER['argc']) ? $_SERVER['argc'] : 0;
20+
$getEnvVar = function ($name, $default = false) use ($argv) {
1821
if (false !== $value = getenv($name)) {
1922
return $value;
2023
}
2124

2225
static $phpunitConfig = null;
2326
if (null === $phpunitConfig) {
27+
$opt = min(array_search('-c', $opts = array_reverse($argv), true) ?: INF, array_search('--configuration', $opts, true) ?: INF);
2428
$phpunitConfigFilename = null;
25-
if (file_exists('phpunit.xml')) {
29+
if (INF !== $opt && isset($opts[$opt - 1])) {
30+
$phpunitConfigFilename = $opts[$opt - 1];
31+
} elseif (file_exists('phpunit.xml')) {
2632
$phpunitConfigFilename = 'phpunit.xml';
2733
} elseif (file_exists('phpunit.xml.dist')) {
2834
$phpunitConfigFilename = 'phpunit.xml.dist';
@@ -185,10 +191,6 @@ class SymfonyBlacklistPhpunit {}
185191
chdir($oldPwd);
186192
}
187193

188-
global $argv, $argc;
189-
$argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
190-
$argc = isset($_SERVER['argc']) ? $_SERVER['argc'] : 0;
191-
192194
if ($PHPUNIT_VERSION < 8.0) {
193195
$argv = array_filter($argv, function ($v) use (&$argc) { if ('--do-not-cache-result' !== $v) return true; --$argc; return false; });
194196
} elseif (filter_var(getenv('SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE'), FILTER_VALIDATE_BOOLEAN)) {

0 commit comments

Comments
 (0)