From 09c97cadf734a67e90c91c3a013e1b35d2c8b5e9 Mon Sep 17 00:00:00 2001 From: Kevin Abel Date: Fri, 6 Jul 2018 21:07:45 -0500 Subject: [PATCH 1/9] Fix PHPT coverage from phpdbg Fixes #3111. Stop using auto_append_file as it doesn't work with the phpdbg sapi. Instead, the job's code is written to a temp file and the coverage instrumentation code takes over the code. --- src/Runner/PhptTestCase.php | 19 +++++++++---------- src/Util/PHP/Template/PhptTestCase.tpl.dist | 10 ++-------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/Runner/PhptTestCase.php b/src/Runner/PhptTestCase.php index 70940704975..a2b501630ce 100644 --- a/src/Runner/PhptTestCase.php +++ b/src/Runner/PhptTestCase.php @@ -150,7 +150,7 @@ public function run(TestResult $result = null): TestResult } if ($result->getCollectCodeCoverageInformation()) { - $this->renderForCoverage($settings); + $this->renderForCoverage($code); } Timer::start(); @@ -488,7 +488,7 @@ private function getCoverageFiles(): array ]; } - private function renderForCoverage(array &$settings): void + private function renderForCoverage(string &$job): void { $files = $this->getCoverageFiles(); @@ -520,17 +520,12 @@ private function renderForCoverage(array &$settings): void 'phar' => $phar, 'globals' => $globals, 'job' => $files['job'], - 'coverageFile' => $files['coverage'], - 'autoPrependFile' => \var_export( - !empty($settings['auto_prepend_file']) ? $settings['auto_prepend_file'] : false, - true - ) + 'coverageFile' => $files['coverage'] ] ); - \file_put_contents($files['job'], $template->render()); - - $settings['auto_prepend_file'] = $files['job']; + \file_put_contents($files['job'], $job); + $job = $template->render(); } private function cleanupForCoverage(): array @@ -538,6 +533,10 @@ private function cleanupForCoverage(): array $files = $this->getCoverageFiles(); $coverage = @\unserialize(\file_get_contents($files['coverage'])); + if ($coverage === false) { + $coverage = []; + } + foreach ($files as $file) { @\unlink($file); } diff --git a/src/Util/PHP/Template/PhptTestCase.tpl.dist b/src/Util/PHP/Template/PhptTestCase.tpl.dist index 83261136eb0..14c3e7e6ef5 100644 --- a/src/Util/PHP/Template/PhptTestCase.tpl.dist +++ b/src/Util/PHP/Template/PhptTestCase.tpl.dist @@ -3,7 +3,6 @@ use SebastianBergmann\CodeCoverage\CodeCoverage; $composerAutoload = {composerAutoload}; $phar = {phar}; -$autoPrependFile = {autoPrependFile}; ob_start(); @@ -28,7 +27,7 @@ if (class_exists('SebastianBergmann\CodeCoverage\CodeCoverage')) { $coverage->start(__FILE__); } -register_shutdown_function(function() use ($coverage, $autoPrependFile) { +register_shutdown_function(function() use ($coverage) { $output = null; if ($coverage) { $output = $coverage->stop(); @@ -38,9 +37,4 @@ register_shutdown_function(function() use ($coverage, $autoPrependFile) { ob_end_clean(); -if ($autoPrependFile) { - require $autoPrependFile; - $includes = get_included_files(); - $GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST'][] = array_pop($includes); - unset($includes); -} +require '{job}'; From caf45d94a3c3fdf6f46fc195813f7afe40928a25 Mon Sep 17 00:00:00 2001 From: Kevin Abel Date: Sat, 7 Jul 2018 16:09:09 -0500 Subject: [PATCH 2/9] Filter stacktrace generated from phpt job file --- src/Runner/PhptTestCase.php | 2 +- src/Util/Filter.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Runner/PhptTestCase.php b/src/Runner/PhptTestCase.php index a2b501630ce..4ab7fec3b79 100644 --- a/src/Runner/PhptTestCase.php +++ b/src/Runner/PhptTestCase.php @@ -479,7 +479,7 @@ private function render(string $code): string private function getCoverageFiles(): array { - $baseDir = \dirname($this->filename) . \DIRECTORY_SEPARATOR; + $baseDir = \dirname(\realpath($this->filename)) . \DIRECTORY_SEPARATOR; $basename = \basename($this->filename, 'phpt'); return [ diff --git a/src/Util/Filter.php b/src/Util/Filter.php index e317471ab52..e57055bafd3 100644 --- a/src/Util/Filter.php +++ b/src/Util/Filter.php @@ -54,6 +54,7 @@ public static function getFilteredStacktrace(\Throwable $t): string foreach ($eTrace as $frame) { if (isset($frame['file']) && \is_file($frame['file']) && + (empty($GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST']) || !\in_array($frame['file'], $GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST'])) && !$blacklist->isBlacklisted($frame['file']) && ($prefix === false || \strpos($frame['file'], $prefix) !== 0) && $frame['file'] !== $script) { From 62734e7c7ab340134ba68fd60f9a1b0bc328376a Mon Sep 17 00:00:00 2001 From: Kevin Abel Date: Sat, 7 Jul 2018 17:00:49 -0500 Subject: [PATCH 3/9] Fix test and expectations with phpdbg sapi Fixes the following differences when running with phpdbg: * phpdbg doesn't ignore the -- argument separator when passed to php * phpdbg doesn't support display_errors=stderr, so errors go to STDOUT * Tests that enable xdebug.scream affect process isolation in phpdbg * Errors/Exceptions/Stacks are formatted slightly different in phpdbg --- .travis.yml | 1 + src/Util/PHP/AbstractPhpProcess.php | 12 +++++++++--- src/Util/PHP/Template/TestCaseClass.tpl.dist | 1 + src/Util/PHP/Template/TestCaseMethod.tpl.dist | 1 + tests/Regression/GitHub/1348.phpt | 2 +- ...ate-function-no-preserve-no-bootstrap-xdebug.phpt | 10 ++++------ tests/Regression/GitHub/873.phpt | 4 ++-- tests/TextUI/code-coverage-phpt.phpt | 8 ++++---- tests/TextUI/fatal-isolation.phpt | 3 +-- tests/Util/PHP/AbstractPhpProcessTest.php | 4 ++-- 10 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 06039903487..fe87a9b2cfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ before_script: script: - ./phpunit --coverage-clover=coverage.xml + - phpdbg -qrr ./phpunit --coverage-text - ./phpunit --configuration ./build/travis-ci-fail.xml > /dev/null; if [ $? -eq 0 ]; then echo "SHOULD FAIL"; false; else echo "fail checked"; fi; - xmllint --noout --schema phpunit.xsd phpunit.xml - xmllint --noout --schema phpunit.xsd tests/_files/configuration.xml diff --git a/src/Util/PHP/AbstractPhpProcess.php b/src/Util/PHP/AbstractPhpProcess.php index 99a7907450c..bacc3eee532 100644 --- a/src/Util/PHP/AbstractPhpProcess.php +++ b/src/Util/PHP/AbstractPhpProcess.php @@ -187,12 +187,18 @@ public function getCommand(array $settings, string $file = null): string } else { $command .= \escapeshellarg(__DIR__ . '/eval-stdin.php'); } - } elseif ($file) { - $command .= ' -f ' . \escapeshellarg($file); + } else { + if ($file) { + $command .= ' -f ' . \escapeshellarg($file); + } + + if ($this->args) { + $command .= ' --'; + } } if ($this->args) { - $command .= ' -- ' . $this->args; + $command .= ' ' . $this->args; } if ($this->stderrRedirection === true) { diff --git a/src/Util/PHP/Template/TestCaseClass.tpl.dist b/src/Util/PHP/Template/TestCaseClass.tpl.dist index 56463740d17..008d54289c2 100644 --- a/src/Util/PHP/Template/TestCaseClass.tpl.dist +++ b/src/Util/PHP/Template/TestCaseClass.tpl.dist @@ -58,6 +58,7 @@ function __phpunit_run_isolated_test() $output = $test->getActualOutput(); } + ini_set('xdebug.scream', 0); @rewind(STDOUT); /* @ as not every STDOUT target stream is rewindable */ if ($stdout = stream_get_contents(STDOUT)) { $output = $stdout . $output; diff --git a/src/Util/PHP/Template/TestCaseMethod.tpl.dist b/src/Util/PHP/Template/TestCaseMethod.tpl.dist index 904aa22501e..c81e6989e03 100644 --- a/src/Util/PHP/Template/TestCaseMethod.tpl.dist +++ b/src/Util/PHP/Template/TestCaseMethod.tpl.dist @@ -60,6 +60,7 @@ function __phpunit_run_isolated_test() $output = $test->getActualOutput(); } + ini_set('xdebug.scream', '0'); @rewind(STDOUT); /* @ as not every STDOUT target stream is rewindable */ if ($stdout = stream_get_contents(STDOUT)) { $output = $stdout . $output; diff --git a/tests/Regression/GitHub/1348.phpt b/tests/Regression/GitHub/1348.phpt index 1df41a25300..f49d9da7271 100644 --- a/tests/Regression/GitHub/1348.phpt +++ b/tests/Regression/GitHub/1348.phpt @@ -2,7 +2,7 @@ https://github.com/sebastianbergmann/phpunit/issues/1348 --SKIPIF-- diff --git a/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-xdebug.phpt b/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-xdebug.phpt index 3182f878510..21e65dd07c9 100644 --- a/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-xdebug.phpt +++ b/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-xdebug.phpt @@ -26,14 +26,12 @@ Time: %s, Memory: %s There were 2 errors: 1) Issue2591_SeparateFunctionNoPreserveTest::testChangedGlobalString -PHPUnit\Framework\Exception: PHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s -PHP Stack trace: +PHPUnit\Framework\Exception:%sPHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s +%SPHP Stack trace:%S %a - 2) Issue2591_SeparateFunctionNoPreserveTest::testGlobalString -PHPUnit\Framework\Exception: PHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s -PHP Stack trace: +PHPUnit\Framework\Exception:%sPHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s +%SPHP Stack trace:%S %a - ERRORS! Tests: 2, Assertions: 0, Errors: 2. diff --git a/tests/Regression/GitHub/873.phpt b/tests/Regression/GitHub/873.phpt index 96ea6b5410c..31623605477 100644 --- a/tests/Regression/GitHub/873.phpt +++ b/tests/Regression/GitHub/873.phpt @@ -16,7 +16,7 @@ require __DIR__ . '/../../bootstrap.php'; PHPUnit\TextUI\Command::main(); ?> --EXPECTF-- - -Fatal error: Uncaught Exception: PHPUnit suppresses exceptions thrown outside of test case function in %s:%i +%A +%SException: PHPUnit suppresses exceptions thrown outside of test case function in %s:%i Stack trace: %a diff --git a/tests/TextUI/code-coverage-phpt.phpt b/tests/TextUI/code-coverage-phpt.phpt index f1d577e54ed..c32817b7be5 100644 --- a/tests/TextUI/code-coverage-phpt.phpt +++ b/tests/TextUI/code-coverage-phpt.phpt @@ -34,10 +34,10 @@ Code Coverage Report:%w %w Summary:%w Classes: 100.00% (2/2)%w - Methods: 100.00% (6/6)%w - Lines: 100.00% (12/12) + Methods: 100.00% (%d/%d)%w + Lines: 100.00% (%d/%d) CoveredClass - Methods: 100.00% ( 3/ 3) Lines: 100.00% ( 7/ 7) + Methods: 100.00% ( %d/ %d) Lines: 100.00% ( %d/ %d) CoveredParentClass - Methods: 100.00% ( 3/ 3) Lines: 100.00% ( 5/ 5) + Methods: 100.00% ( %d/ %d) Lines: 100.00% ( %d/ %d) diff --git a/tests/TextUI/fatal-isolation.phpt b/tests/TextUI/fatal-isolation.phpt index 4aa908a6ab3..bfa7340879e 100644 --- a/tests/TextUI/fatal-isolation.phpt +++ b/tests/TextUI/fatal-isolation.phpt @@ -19,7 +19,6 @@ Time: %s, Memory: %s There was 1 error: 1) FatalTest::testFatalError -%s - +%a ERRORS! Tests: 1, Assertions: 0, Errors: 1. diff --git a/tests/Util/PHP/AbstractPhpProcessTest.php b/tests/Util/PHP/AbstractPhpProcessTest.php index 5544a0985e9..c5a8721e255 100644 --- a/tests/Util/PHP/AbstractPhpProcessTest.php +++ b/tests/Util/PHP/AbstractPhpProcessTest.php @@ -55,7 +55,7 @@ public function testShouldUseGivenSettingsToCreateCommand(): void 'display_errors=1', ]; - $expectedCommandFormat = '%s -d %callow_url_fopen=1%c -d %cauto_append_file=%c -d %cdisplay_errors=1%c'; + $expectedCommandFormat = '%s -d %callow_url_fopen=1%c -d %cauto_append_file=%c -d %cdisplay_errors=1%c%S'; $actualCommand = $this->phpProcess->getCommand($settings); $this->assertStringMatchesFormat($expectedCommandFormat, $actualCommand); @@ -75,7 +75,7 @@ public function testShouldUseArgsToCreateCommand(): void { $this->phpProcess->setArgs('foo=bar'); - $expectedCommandFormat = '%s -- foo=bar'; + $expectedCommandFormat = '%s foo=bar'; $actualCommand = $this->phpProcess->getCommand([]); $this->assertStringMatchesFormat($expectedCommandFormat, $actualCommand); From 93a8ca2ac8b6c6a5cab3f961786ec3ec4b6e867a Mon Sep 17 00:00:00 2001 From: Kevin Abel Date: Sat, 7 Jul 2018 17:36:47 -0500 Subject: [PATCH 4/9] Additional test output differences in phpdbg Also disables xdebug for phpdbg run --- .travis.yml | 1 + .../2591-separate-function-no-preserve-no-bootstrap.phpt | 8 ++++---- tests/Regression/GitHub/873.phpt | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index fe87a9b2cfb..d2a66f60116 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ before_script: script: - ./phpunit --coverage-clover=coverage.xml + - phpenv config-rm xdebug.ini - phpdbg -qrr ./phpunit --coverage-text - ./phpunit --configuration ./build/travis-ci-fail.xml > /dev/null; if [ $? -eq 0 ]; then echo "SHOULD FAIL"; false; else echo "fail checked"; fi; - xmllint --noout --schema phpunit.xsd phpunit.xml diff --git a/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap.phpt b/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap.phpt index 465004db7ad..b82f22466a0 100644 --- a/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap.phpt +++ b/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap.phpt @@ -28,10 +28,10 @@ Time: %s, Memory: %s There were 2 errors: 1) Issue2591_SeparateFunctionNoPreserveTest::testChangedGlobalString -PHPUnit\Framework\Exception: PHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s - +PHPUnit\Framework\Exception:%sPHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s +%A 2) Issue2591_SeparateFunctionNoPreserveTest::testGlobalString -PHPUnit\Framework\Exception: PHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s - +PHPUnit\Framework\Exception:%sPHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s +%A ERRORS! Tests: 2, Assertions: 0, Errors: 2. diff --git a/tests/Regression/GitHub/873.phpt b/tests/Regression/GitHub/873.phpt index 31623605477..f0048978471 100644 --- a/tests/Regression/GitHub/873.phpt +++ b/tests/Regression/GitHub/873.phpt @@ -16,7 +16,6 @@ require __DIR__ . '/../../bootstrap.php'; PHPUnit\TextUI\Command::main(); ?> --EXPECTF-- -%A -%SException: PHPUnit suppresses exceptions thrown outside of test case function in %s:%i +%AException: PHPUnit suppresses exceptions thrown outside of test case function in %s:%i Stack trace: %a From 6e49f0b990c6b8b087fb3458e72fff0287105d05 Mon Sep 17 00:00:00 2001 From: Kevin Abel Date: Sat, 7 Jul 2018 17:52:58 -0500 Subject: [PATCH 5/9] Fix 7.3 test output for phpdbg --- .travis.yml | 2 +- ...te-function-no-preserve-no-bootstrap-php73.phpt | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2a66f60116..8f4f043d1e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ before_script: script: - ./phpunit --coverage-clover=coverage.xml - - phpenv config-rm xdebug.ini + - phpenv config-rm xdebug.ini; true - phpdbg -qrr ./phpunit --coverage-text - ./phpunit --configuration ./build/travis-ci-fail.xml > /dev/null; if [ $? -eq 0 ]; then echo "SHOULD FAIL"; false; else echo "fail checked"; fi; - xmllint --noout --schema phpunit.xsd phpunit.xml diff --git a/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-php73.phpt b/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-php73.phpt index 96a18a76fcd..020b51e6219 100644 --- a/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-php73.phpt +++ b/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-php73.phpt @@ -28,20 +28,12 @@ Time: %s, Memory: %s There were 2 errors: 1) Issue2591_SeparateFunctionNoPreserveTest::testChangedGlobalString -PHPUnit\Framework\Exception: PHP Fatal error: Uncaught Error: Class 'PHPUnit\Framework\TestCase' not found in %s/SeparateFunctionNoPreserveTest.php:%d +PHPUnit\Framework\Exception: %sUncaught Error: Class 'PHPUnit\Framework\TestCase' not found in %s/SeparateFunctionNoPreserveTest.php:%d%S Stack trace: -#0 Standard input code(31): require_once() -#1 Standard input code(110): __phpunit_run_isolated_test() -#2 {main} - thrown in %s on line %d - +%a 2) Issue2591_SeparateFunctionNoPreserveTest::testGlobalString PHPUnit\Framework\Exception: PHP Fatal error: Uncaught Error: Class 'PHPUnit\Framework\TestCase' not found in %s:%d Stack trace: -#0 Standard input code(31): require_once() -#1 Standard input code(110): __phpunit_run_isolated_test() -#2 {main} - thrown in %s on line %d - +%a ERRORS! Tests: 2, Assertions: 0, Errors: 2. From 84a3ddf0a498935c36890885a0940430b3a680be Mon Sep 17 00:00:00 2001 From: Kevin Abel Date: Sat, 7 Jul 2018 18:26:52 -0500 Subject: [PATCH 6/9] Fix another 7.3 test output difference with phpdbg --- ...91-separate-function-no-preserve-no-bootstrap-php73.phpt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-php73.phpt b/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-php73.phpt index 020b51e6219..2b5e4f9f0ac 100644 --- a/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-php73.phpt +++ b/tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-php73.phpt @@ -28,12 +28,10 @@ Time: %s, Memory: %s There were 2 errors: 1) Issue2591_SeparateFunctionNoPreserveTest::testChangedGlobalString -PHPUnit\Framework\Exception: %sUncaught Error: Class 'PHPUnit\Framework\TestCase' not found in %s/SeparateFunctionNoPreserveTest.php:%d%S -Stack trace: +PHPUnit\Framework\Exception: %sUncaught Error%sin %s %a 2) Issue2591_SeparateFunctionNoPreserveTest::testGlobalString -PHPUnit\Framework\Exception: PHP Fatal error: Uncaught Error: Class 'PHPUnit\Framework\TestCase' not found in %s:%d -Stack trace: +PHPUnit\Framework\Exception: %sUncaught Error%sin %s %a ERRORS! Tests: 2, Assertions: 0, Errors: 2. From d4f9ac940116e27adf01064f38b3200502f20227 Mon Sep 17 00:00:00 2001 From: Kevin Abel Date: Sun, 8 Jul 2018 11:26:43 -0500 Subject: [PATCH 7/9] Remove travis changes used to validate phpdbg compatibility --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8f4f043d1e5..06039903487 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,8 +37,6 @@ before_script: script: - ./phpunit --coverage-clover=coverage.xml - - phpenv config-rm xdebug.ini; true - - phpdbg -qrr ./phpunit --coverage-text - ./phpunit --configuration ./build/travis-ci-fail.xml > /dev/null; if [ $? -eq 0 ]; then echo "SHOULD FAIL"; false; else echo "fail checked"; fi; - xmllint --noout --schema phpunit.xsd phpunit.xml - xmllint --noout --schema phpunit.xsd tests/_files/configuration.xml From 34b954a2326d60cdf59566aaef51b7c670fa59d1 Mon Sep 17 00:00:00 2001 From: Kevin Abel Date: Sun, 8 Jul 2018 16:47:43 -0500 Subject: [PATCH 8/9] Clean up the php process command builder * Gets rid of the need for eval-stdin.php in phpdbg with the s option * Only include the args separator when a file is not given --- src/Util/PHP/AbstractPhpProcess.php | 21 +++++++++------------ tests/Util/PHP/AbstractPhpProcessTest.php | 3 +-- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/Util/PHP/AbstractPhpProcess.php b/src/Util/PHP/AbstractPhpProcess.php index bacc3eee532..fba0b9600b8 100644 --- a/src/Util/PHP/AbstractPhpProcess.php +++ b/src/Util/PHP/AbstractPhpProcess.php @@ -180,24 +180,21 @@ public function getCommand(array $settings, string $file = null): string $command .= $this->settingsToParameters($settings); if (\PHP_SAPI === 'phpdbg') { - $command .= ' -qrr '; + $command .= ' -qrr'; - if ($file) { - $command .= '-e ' . \escapeshellarg($file); - } else { - $command .= \escapeshellarg(__DIR__ . '/eval-stdin.php'); - } - } else { - if ($file) { - $command .= ' -f ' . \escapeshellarg($file); + if (!$file) { + $command .= 's='; } + } - if ($this->args) { - $command .= ' --'; - } + if ($file) { + $command .= ' ' . \escapeshellarg($file); } if ($this->args) { + if (!$file) { + $command .= ' --'; + } $command .= ' ' . $this->args; } diff --git a/tests/Util/PHP/AbstractPhpProcessTest.php b/tests/Util/PHP/AbstractPhpProcessTest.php index c5a8721e255..862d5ea2dbd 100644 --- a/tests/Util/PHP/AbstractPhpProcessTest.php +++ b/tests/Util/PHP/AbstractPhpProcessTest.php @@ -83,8 +83,7 @@ public function testShouldUseArgsToCreateCommand(): void public function testShouldHaveFileToCreateCommand(): void { - $argumentEscapingCharacter = \DIRECTORY_SEPARATOR === '\\' ? '"' : '\''; - $expectedCommandFormat = \sprintf('%%s -%%c %1$sfile.php%1$s', $argumentEscapingCharacter); + $expectedCommandFormat = '%s %cfile.php%c'; $actualCommand = $this->phpProcess->getCommand([], 'file.php'); $this->assertStringMatchesFormat($expectedCommandFormat, $actualCommand); From 0ce3e2c0ab23412e46039303a07ec16df0559c30 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Mon, 9 Jul 2018 07:21:45 +0200 Subject: [PATCH 9/9] Update ChangeLog --- ChangeLog-7.2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog-7.2.md b/ChangeLog-7.2.md index 0b1a1397d6f..b778c36d8a4 100644 --- a/ChangeLog-7.2.md +++ b/ChangeLog-7.2.md @@ -7,6 +7,7 @@ All notable changes of the PHPUnit 7.2 release series are documented in this fil ### Fixed * Fixed [#3189](https://github.com/sebastianbergmann/phpunit/issues/3189): PHPUnit 7.2 potentially leaves a messy libxmlerror state +* Fixed [#3199](https://github.com/sebastianbergmann/phpunit/pull/3199): Code Coverage for PHPT tests does not work when PHPDBG is used ## [7.2.6] - 2018-06-21