Skip to content

Commit d88c33c

Browse files
authored
Merge branch 'sebastianbergmann:main' into codecoverage-update-to-bootstrap-5-add-theme
2 parents 8dccbc7 + 3dd4455 commit d88c33c

File tree

16 files changed

+375
-293
lines changed

16 files changed

+375
-293
lines changed

.phive/phars.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
33
<phar name="phpab" version="^1.29" installed="1.29.1" location="./tools/phpab" copy="true"/>
4-
<phar name="php-cs-fixer" version="^3.53" installed="3.54.0" location="./tools/php-cs-fixer" copy="true"/>
5-
<phar name="psalm" version="^5.23" installed="5.23.1" location="./tools/psalm" copy="true"/>
4+
<phar name="php-cs-fixer" version="^3.53" installed="3.56.1" location="./tools/php-cs-fixer" copy="true"/>
5+
<phar name="psalm" version="^5.23" installed="5.24.0" location="./tools/psalm" copy="true"/>
66
<phar name="humbug/php-scoper" version="^0.18" installed="0.18.11" location="./tools/php-scoper" copy="true"/>
7+
<phar name="composer" version="^2.7" installed="2.7.6" location="./tools/composer" copy="true"/>
78
<phar name="infection" version="^0.28" installed="0.28.1" location="./tools/infection" copy="true"/>
8-
<phar name="composer" version="^2.7" installed="2.7.4" location="./tools/composer" copy="true"/>
99
</phive>

.psalm/baseline.xml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
2+
<files psalm-version="5.24.0@462c80e31c34e58cc4f750c656be3927e80e550e">
33
<file src="src/Event/Dispatcher/DirectDispatcher.php">
44
<UndefinedInterfaceMethod>
55
<code><![CDATA[notify]]></code>
@@ -378,18 +378,20 @@
378378
<code><![CDATA[$groups]]></code>
379379
</PropertyTypeCoercion>
380380
</file>
381-
<file src="src/Framework/TestRunner.php">
382-
<ArgumentTypeCoercion>
383-
<code><![CDATA[$cce->getMessage()]]></code>
384-
<code><![CDATA[$test->output()]]></code>
385-
</ArgumentTypeCoercion>
381+
<file src="src/Framework/TestRunner/SeparateProcessTestRunner.php">
386382
<InvalidArgument>
387383
<code><![CDATA[$var]]></code>
388384
</InvalidArgument>
389385
<MissingThrowsDocblock>
390386
<code><![CDATA[bootstrap]]></code>
391387
</MissingThrowsDocblock>
392388
</file>
389+
<file src="src/Framework/TestRunner/TestRunner.php">
390+
<ArgumentTypeCoercion>
391+
<code><![CDATA[$cce->getMessage()]]></code>
392+
<code><![CDATA[$test->output()]]></code>
393+
</ArgumentTypeCoercion>
394+
</file>
393395
<file src="src/Framework/TestSuite.php">
394396
<ArgumentTypeCoercion>
395397
<code><![CDATA[$this->name]]></code>
@@ -533,6 +535,8 @@
533535
* >]]></code>
534536
</InvalidReturnType>
535537
<RiskyTruthyFalsyComparison>
538+
<code><![CDATA[empty($matches['version'])]]></code>
539+
<code><![CDATA[empty($requires[$matches['name']])]]></code>
536540
<code><![CDATA[preg_match_all('/@(?P<name>[A-Za-z_-]+)(?:[ \t]+(?P<value>.*?))?[ \t]*\r?$/m', $docBlock, $matches)]]></code>
537541
</RiskyTruthyFalsyComparison>
538542
</file>
@@ -562,6 +566,9 @@
562566
<ArgumentTypeCoercion>
563567
<code><![CDATA[!empty($matches['operator']) ? $matches['operator'] : '>=']]></code>
564568
</ArgumentTypeCoercion>
569+
<RiskyTruthyFalsyComparison>
570+
<code><![CDATA[empty($matches['operator'])]]></code>
571+
</RiskyTruthyFalsyComparison>
565572
</file>
566573
<file src="src/Runner/Baseline/RelativePathCalculator.php">
567574
<LessSpecificReturnStatement>
@@ -656,7 +663,7 @@
656663
<code><![CDATA[TestIdFilterIterator]]></code>
657664
</MissingTemplateParam>
658665
</file>
659-
<file src="src/Runner/PhptTestCase.php">
666+
<file src="src/Runner/PHPT/PhptTestCase.php">
660667
<ArgumentTypeCoercion>
661668
<code><![CDATA[$arguments]]></code>
662669
<code><![CDATA[$message]]></code>

build.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,13 @@
312312
<arg path="${basedir}/build/tmp/phar" />
313313
</exec>
314314

315-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/PhptTestCase.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\CodeCoverage"/>
316-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/PhptTestCase.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\Driver\Selector"/>
317-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/PhptTestCase.tpl" token="SebastianBergmann\CodeCoverage\Filter" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\Filter"/>
318-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseClass.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\CodeCoverage"/>
319-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseClass.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\Driver\Selector"/>
320-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseMethod.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\CodeCoverage"/>
321-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseMethod.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\Driver\Selector"/>
315+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Runner/PHPT/templates/phpt.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\CodeCoverage"/>
316+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Runner/PHPT/templates/phpt.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\Driver\Selector"/>
317+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Runner/PHPT/templates/phpt.tpl" token="SebastianBergmann\CodeCoverage\Filter" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\Filter"/>
318+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Framework/TestRunner/templates/class.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\CodeCoverage"/>
319+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Framework/TestRunner/templates/class.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\Driver\Selector"/>
320+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Framework/TestRunner/templates/method.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\CodeCoverage"/>
321+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Framework/TestRunner/templates/method.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnitPHAR\SebastianBergmann\CodeCoverage\Driver\Selector"/>
322322

323323
<copy file="${basedir}/.phpstorm.meta.php" tofile="${basedir}/build/tmp/phar-scoped/.phpstorm.meta.php"/>
324324

src/Framework/TestCase.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,15 @@ final public function run(): void
347347

348348
if (!$this->shouldRunInSeparateProcess()) {
349349
(new TestRunner)->run($this);
350-
} else {
351-
(new TestRunner)->runInSeparateProcess(
352-
$this,
353-
$this->runClassInSeparateProcess && !$this->runTestInSeparateProcess,
354-
$this->preserveGlobalState,
355-
);
350+
351+
return;
356352
}
353+
354+
IsolatedTestRunnerRegistry::run(
355+
$this,
356+
$this->runClassInSeparateProcess && !$this->runTestInSeparateProcess,
357+
$this->preserveGlobalState,
358+
);
357359
}
358360

359361
/**
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <sebastian@phpunit.de>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace PHPUnit\Framework;
11+
12+
/**
13+
* @internal This interface is not covered by the backward compatibility promise for PHPUnit
14+
*/
15+
interface IsolatedTestRunner
16+
{
17+
public function run(TestCase $test, bool $runEntireClass, bool $preserveGlobalState): void;
18+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <sebastian@phpunit.de>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace PHPUnit\Framework;
11+
12+
/**
13+
* @internal This class is not covered by the backward compatibility promise for PHPUnit
14+
*/
15+
final class IsolatedTestRunnerRegistry
16+
{
17+
private static ?IsolatedTestRunner $runner = null;
18+
19+
public static function run(TestCase $test, bool $runEntireClass, bool $preserveGlobalState): void
20+
{
21+
if (self::$runner === null) {
22+
self::$runner = new SeparateProcessTestRunner;
23+
}
24+
25+
self::$runner->run($test, $runEntireClass, $preserveGlobalState);
26+
}
27+
28+
public static function set(IsolatedTestRunner $runner): void
29+
{
30+
self::$runner = $runner;
31+
}
32+
}

0 commit comments

Comments
 (0)