Skip to content

Commit

Permalink
Merge branch '10.5' into 11.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Oct 8, 2024
2 parents ae62a3f + 1dd66e1 commit 360f0f0
Show file tree
Hide file tree
Showing 154 changed files with 222 additions and 1,201 deletions.
19 changes: 18 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,27 @@
},
"autoload-dev": {
"classmap": [
"tests/"
"tests/_files"
],
"files": [
"tests/_files/deprecation-trigger/trigger_deprecation.php",
"tests/unit/Event/AbstractEventTestCase.php",
"tests/unit/Framework/MockObject/TestDoubleTestCase.php",
"tests/unit/Metadata/Parser/AnnotationParserTestCase.php",
"tests/unit/Metadata/Parser/AttributeParserTestCase.php",
"tests/unit/Framework/Assert/assertDirectoryExistsTest.php",
"tests/unit/Framework/Assert/assertFileExistsTest.php",
"tests/unit/Framework/Assert/assertIsNumericTest.php",
"tests/unit/Framework/Assert/assertIsObjectTest.php",
"tests/unit/Framework/Assert/assertIsReadableTest.php",
"tests/unit/Framework/Assert/assertIsResourceTest.php",
"tests/unit/Framework/Assert/assertIsScalarTest.php",
"tests/unit/Framework/Assert/assertIsStringTest.php",
"tests/unit/Framework/Assert/assertIsWritableTest.php",
"tests/unit/Framework/Assert/assertMatchesRegularExpressionTest.php",
"tests/unit/Framework/Assert/assertNullTest.php",
"tests/unit/Framework/Assert/assertSameSizeTest.php",
"tests/unit/Framework/Assert/assertSameTest.php",
"tests/_files/CoverageNamespacedFunctionTest.php",
"tests/_files/CoveredFunction.php",
"tests/_files/Generator.php",
Expand Down
4 changes: 3 additions & 1 deletion src/Runner/CodeCoverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ public function generateReports(Printer $printer, Configuration $configuration):
$textReport = $processor->process($this->codeCoverage(), $configuration->colors());

if ($configuration->coverageText() === 'php://stdout') {
$printer->print($textReport);
if (!$configuration->noOutput() && !$configuration->debug()) {
$printer->print($textReport);
}
} else {
file_put_contents($configuration->coverageText(), $textReport);
}
Expand Down
File renamed without changes.
10 changes: 1 addition & 9 deletions tests/end-to-end/cli/exclude-filter/match.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@
phpunit --exclude-filter testThree ../../_files/groups/tests/FooTest.php
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--exclude-filter';
$_SERVER['argv'][] = 'testThree';
$_SERVER['argv'][] = __DIR__ . '/../../_files/groups/tests/FooTest.php';

require_once __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@
Test Runner exits with shell exit code indicating success by default when no tests were run
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--filter';
$_SERVER['argv'][] = 'doesNotExist';
$_SERVER['argv'][] = __DIR__ . '/../../event/_files/SuccessTest.php';

require __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
10 changes: 1 addition & 9 deletions tests/end-to-end/cli/fail-on/fail-on-deprecation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,15 @@
Test Runner exits with shell exit code indicating failure when all tests are successful but at least one test triggered a deprecation
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--fail-on-deprecation';
$_SERVER['argv'][] = __DIR__ . '/../../_files/stop-on-fail-on/DeprecationTest.php';

require __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
10 changes: 1 addition & 9 deletions tests/end-to-end/cli/fail-on/fail-on-empty-test-suite.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
Test Runner exits with shell exit code indicating failure when no tests were run and --fail-on-empty-test-suite option is used
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--filter';
$_SERVER['argv'][] = 'doesNotExist';
$_SERVER['argv'][] = '--fail-on-empty-test-suite';
Expand All @@ -17,10 +13,6 @@ $_SERVER['argv'][] = __DIR__ . '/../../event/_files/SuccessTest.php';
require __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
10 changes: 1 addition & 9 deletions tests/end-to-end/cli/fail-on/fail-on-incomplete.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,15 @@
Test Runner exits with shell exit code indicating failure when all tests are successful but at least one test was marked incomplete
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--fail-on-incomplete';
$_SERVER['argv'][] = __DIR__ . '/../../_files/stop-on-fail-on/IncompleteTest.php';

require __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
10 changes: 1 addition & 9 deletions tests/end-to-end/cli/fail-on/fail-on-notice.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,15 @@
Test Runner exits with shell exit code indicating failure when all tests are successful but at least one test triggered a notice
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--fail-on-notice';
$_SERVER['argv'][] = __DIR__ . '/../../_files/stop-on-fail-on/NoticeTest.php';

require __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
10 changes: 1 addition & 9 deletions tests/end-to-end/cli/fail-on/fail-on-phpunit-deprecation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,15 @@
Test Runner exits with shell exit code indicating failure when all tests are successful but at least one test triggered a PHPUnit deprecation
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--fail-on-phpunit-deprecation';
$_SERVER['argv'][] = __DIR__ . '/../../_files/stop-on-fail-on/DeprecationTest.php';

require __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
10 changes: 1 addition & 9 deletions tests/end-to-end/cli/fail-on/fail-on-risky.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,15 @@
Test Runner exits with shell exit code indicating failure when all tests are successful but at least one test was considered risky
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--fail-on-risky';
$_SERVER['argv'][] = __DIR__ . '/../../_files/stop-on-fail-on/RiskyTest.php';

require __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
10 changes: 1 addition & 9 deletions tests/end-to-end/cli/fail-on/fail-on-skipped.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,15 @@
Test Runner exits with shell exit code indicating failure when all tests are successful but at least one test was skipped
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--fail-on-skipped';
$_SERVER['argv'][] = __DIR__ . '/../../_files/stop-on-fail-on/SkippedTest.php';

require __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
10 changes: 1 addition & 9 deletions tests/end-to-end/cli/fail-on/fail-on-warning.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,15 @@
Test Runner exits with shell exit code indicating failure when all tests are successful but at least one warning was triggered
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--fail-on-warning';
$_SERVER['argv'][] = __DIR__ . '/../../_files/stop-on-fail-on/WarningTest.php';

require __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
10 changes: 1 addition & 9 deletions tests/end-to-end/cli/filter/filter-class-match-argument.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@
phpunit --filter FooTest tests/FooTest.php
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--filter';
$_SERVER['argv'][] = 'FooTest';
$_SERVER['argv'][] = __DIR__ . '/../../_files/groups/tests/FooTest.php';

require_once __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@
phpunit --filter FooTest
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--configuration';
$_SERVER['argv'][] = __DIR__ . '/../../_files/groups';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--filter';
$_SERVER['argv'][] = 'FooTest';

require_once __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
10 changes: 1 addition & 9 deletions tests/end-to-end/cli/filter/filter-class-nomatch-argument.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@
phpunit --filter BarTest tests/FooTest.php
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--filter';
$_SERVER['argv'][] = 'BarTest';
$_SERVER['argv'][] = __DIR__ . '/../../_files/groups/tests/FooTest.php';

require_once __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@
phpunit --filter BarTest
--FILE--
<?php declare(strict_types=1);
$traceFile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--configuration';
$_SERVER['argv'][] = __DIR__ . '/../../_files/groups';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--filter';
$_SERVER['argv'][] = 'BarTest';

require_once __DIR__ . '/../../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Expand Down
Loading

0 comments on commit 360f0f0

Please sign in to comment.