Skip to content

Commit

Permalink
Merge branch '7.x' into php8.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk authored Sep 25, 2024
2 parents c85a603 + 9964b69 commit c0b3bee
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 23 deletions.
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@
"ext-pcre": "*",
"ext-reflection": "*",
"ext-simplexml": "*",
"fidry/cpu-core-counter": "^1.1.0",
"fidry/cpu-core-counter": "^1.2.0",
"jean85/pretty-package-versions": "^2.0.6",
"phpunit/php-code-coverage": "^11.0.5",
"phpunit/php-file-iterator": "^5.0.1",
"phpunit/php-code-coverage": "^11.0.6",
"phpunit/php-file-iterator": "^5.1.0",
"phpunit/php-timer": "^7.0.1",
"phpunit/phpunit": "^11.3.1",
"phpunit/phpunit": "^11.3.6",
"sebastian/environment": "^7.2.0",
"symfony/console": "^6.4.10 || ^7.1.3",
"symfony/console": "^6.4.11 || ^7.1.4",
"symfony/process": "^6.4.8 || ^7.1.3"
},
"require-dev": {
"ext-pcov": "*",
"ext-posix": "*",
"doctrine/coding-standard": "^12.0.0",
"infection/infection": "^0.29.6",
"phpstan/phpstan": "^1.11.11",
"phpstan/phpstan-deprecation-rules": "^1.2.0",
"phpstan/phpstan": "^1.12.4",
"phpstan/phpstan-deprecation-rules": "^1.2.1",
"phpstan/phpstan-phpunit": "^1.4.0",
"phpstan/phpstan-strict-rules": "^1.6.0",
"squizlabs/php_codesniffer": "^3.10.2",
"phpstan/phpstan-strict-rules": "^1.6.1",
"squizlabs/php_codesniffer": "^3.10.3",
"symfony/filesystem": "^6.4.9 || ^7.1.2"
},
"autoload": {
Expand Down
4 changes: 3 additions & 1 deletion src/JUnit/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/** @internal */
final class Writer
{
private const TESTSUITES_NAME = 'PHPUnit tests';
private readonly DOMDocument $document;

public function __construct()
Expand All @@ -47,6 +48,7 @@ private function getXml(TestSuite $testSuite): string
{
$xmlTestsuites = $this->document->createElement('testsuites');
$xmlTestsuites->appendChild($this->createSuiteNode($testSuite));
$xmlTestsuites->setAttribute('name', self::TESTSUITES_NAME);
$this->document->appendChild($xmlTestsuites);

$xml = $this->document->saveXML();
Expand All @@ -58,7 +60,7 @@ private function getXml(TestSuite $testSuite): string
private function createSuiteNode(TestSuite $parentSuite): DOMElement
{
$suiteNode = $this->document->createElement('testsuite');
$suiteNode->setAttribute('name', $parentSuite->name);
$suiteNode->setAttribute('name', $parentSuite->name !== self::TESTSUITES_NAME ? $parentSuite->name : '');
if ($parentSuite->file !== '') {
$suiteNode->setAttribute('file', $parentSuite->file);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ final class Options
* @param non-empty-string $runner
* @param non-empty-string $tmpDir
*/
private function __construct(
public function __construct(
public readonly Configuration $configuration,
public readonly string $phpunit,
public readonly string $cwd,
Expand Down
5 changes: 4 additions & 1 deletion src/WrapperRunner/ApplicationForWrapperWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ private function bootstrap(): void
}

if (isset($this->testdoxFile)) {
$this->testdoxResultCollector = new TestResultCollector(EventFacade::instance());
$this->testdoxResultCollector = new TestResultCollector(
EventFacade::instance(),
$this->configuration->source(),
);
}

TestResultFacade::init();
Expand Down
4 changes: 2 additions & 2 deletions src/WrapperRunner/ResultPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function printResults(TestResult $testResult, array $teamcityFiles, array
$this->printer,
true,
true,
true,
$this->options->configuration->displayDetailsOnPhpunitDeprecations(),
true,
true,
true,
Expand All @@ -219,7 +219,7 @@ public function printResults(TestResult $testResult, array $teamcityFiles, array
$this->printer,
true,
true,
true,
$this->options->configuration->displayDetailsOnPhpunitDeprecations(),
false,
false,
false,
Expand Down
1 change: 1 addition & 0 deletions src/WrapperRunner/WrapperRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ private function complete(TestResult $testResultSum): int

$exitcode = (new ShellExitCodeCalculator())->calculate(
$this->options->configuration->failOnDeprecation(),
$this->options->configuration->failOnPhpunitDeprecation(),
$this->options->configuration->failOnEmptyTestSuite(),
$this->options->configuration->failOnIncomplete(),
$this->options->configuration->failOnNotice(),
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/common_results/combined.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuites name="PHPUnit tests">
<testsuite name="" tests="7" assertions="3" errors="1" failures="1" skipped="2" time="1.234567">
<testsuite name="ParaTest\Tests\fixtures\common_results\ErrorTest" file="./test/fixtures/common_results/ErrorTest.php" tests="1" assertions="0" errors="1" failures="0" skipped="0" time="1.234567">
<testcase name="testError" file="./test/fixtures/common_results/ErrorTest.php" line="13" class="ParaTest\Tests\fixtures\common_results\ErrorTest" classname="ParaTest.Tests.fixtures.common_results.ErrorTest" assertions="0" time="1.234567">
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/common_results/junit/ErrorTest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuites name="PHPUnit tests">
<testsuite name="ParaTest\Tests\fixtures\common_results\ErrorTest" file="./test/fixtures/common_results/ErrorTest.php" tests="1" assertions="0" errors="1" failures="0" skipped="0" time="1.234567">
<testcase name="testError" file="./test/fixtures/common_results/ErrorTest.php" line="13" class="ParaTest\Tests\fixtures\common_results\ErrorTest" classname="ParaTest.Tests.fixtures.common_results.ErrorTest" assertions="0" time="1.234567">
<error type="RuntimeException">ParaTest\Tests\fixtures\common_results\ErrorTest::testError
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/common_results/junit/FailureTest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuites name="PHPUnit tests">
<testsuite name="ParaTest\Tests\fixtures\common_results\FailureTest" file="./test/fixtures/common_results/FailureTest.php" tests="1" assertions="1" errors="0" failures="1" skipped="0" time="1.234567">
<testcase name="testFailure" file="./test/fixtures/common_results/FailureTest.php" line="12" class="ParaTest\Tests\fixtures\common_results\FailureTest" classname="ParaTest.Tests.fixtures.common_results.FailureTest" assertions="1" time="1.234567">
<failure type="PHPUnit\Framework\ExpectationFailedException">ParaTest\Tests\fixtures\common_results\FailureTest::testFailure
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/common_results/junit/IncompleteTest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuites name="PHPUnit tests">
<testsuite name="ParaTest\Tests\fixtures\common_results\IncompleteTest" file="./test/fixtures/common_results/IncompleteTest.php" tests="1" assertions="0" errors="0" failures="0" skipped="1" time="1.234567">
<testcase name="testIncomplete" file="./test/fixtures/common_results/IncompleteTest.php" line="12" class="ParaTest\Tests\fixtures\common_results\IncompleteTest" classname="ParaTest.Tests.fixtures.common_results.IncompleteTest" assertions="0" time="1.234567">
<skipped/>
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/common_results/junit/RiskyTest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuites name="PHPUnit tests">
<testsuite name="ParaTest\Tests\fixtures\common_results\RiskyTest" file="./test/fixtures/common_results/RiskyTest.php" tests="1" assertions="0" errors="0" failures="0" skipped="0" time="1.234567">
<testcase name="testRisky" file="./test/fixtures/common_results/RiskyTest.php" line="12" class="ParaTest\Tests\fixtures\common_results\RiskyTest" classname="ParaTest.Tests.fixtures.common_results.RiskyTest" assertions="0" time="1.234567"/>
</testsuite>
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/common_results/junit/SkippedTest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuites name="PHPUnit tests">
<testsuite name="ParaTest\Tests\fixtures\common_results\SkippedTest" file="./test/fixtures/common_results/SkippedTest.php" tests="1" assertions="0" errors="0" failures="0" skipped="1" time="1.234567">
<testcase name="testSkipped" file="./test/fixtures/common_results/SkippedTest.php" line="12" class="ParaTest\Tests\fixtures\common_results\SkippedTest" classname="ParaTest.Tests.fixtures.common_results.SkippedTest" assertions="0" time="1.234567">
<skipped/>
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/common_results/junit/SuccessTest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuites name="PHPUnit tests">
<testsuite name="ParaTest\Tests\fixtures\common_results\SuccessTest" file="./test/fixtures/common_results/SuccessTest.php" tests="1" assertions="1" errors="0" failures="0" skipped="0" time="1.234567">
<testcase name="testSuccess" file="./test/fixtures/common_results/SuccessTest.php" line="12" class="ParaTest\Tests\fixtures\common_results\SuccessTest" classname="ParaTest.Tests.fixtures.common_results.SuccessTest" assertions="1" time="1.234567"/>
</testsuite>
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/common_results/junit/WarningTest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuites name="PHPUnit tests">
<testsuite name="ParaTest\Tests\fixtures\common_results\WarningTest" file="./test/fixtures/common_results/WarningTest.php" tests="1" assertions="1" errors="0" failures="0" skipped="0" time="1.234567">
<testcase name="testWarning" file="./test/fixtures/common_results/WarningTest.php" line="16" class="ParaTest\Tests\fixtures\common_results\WarningTest" classname="ParaTest.Tests.fixtures.common_results.WarningTest" assertions="1" time="1.234567"/>
</testsuite>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuites name="PHPUnit tests">
<testsuite name="ParaTest\Tests\fixtures\special_chars\UnitTestWithDataProviderSpecialCharsTest" file="./test/fixtures/special_chars/UnitTestWithDataProviderSpecialCharsTest.php" tests="42" assertions="42" errors="0" failures="42" skipped="0" time="1.234567">
<testsuite name="ParaTest\Tests\fixtures\special_chars\UnitTestWithDataProviderSpecialCharsTest::testIsItFalse" tests="42" assertions="42" errors="0" failures="42" skipped="0" time="1.234567">
<testcase name="testIsItFalse with data set #0" file="./test/fixtures/special_chars/UnitTestWithDataProviderSpecialCharsTest.php" line="16" class="ParaTest\Tests\fixtures\special_chars\UnitTestWithDataProviderSpecialCharsTest" classname="ParaTest.Tests.fixtures.special_chars.UnitTestWithDataProviderSpecialCharsTest" assertions="1" time="1.234567">
Expand Down

0 comments on commit c0b3bee

Please sign in to comment.