Skip to content

Commit

Permalink
Merge branch '11.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jan 10, 2025
2 parents 3658461 + a4f17fb commit 4366435
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/TextUI/Command/Commands/ListGroupsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ public function execute(): Result
);

foreach ($groups as $group => $numberOfTests) {
if (str_starts_with($group, '__phpunit_')) {
if (str_starts_with((string) $group, '__phpunit_')) {
continue;
}

$buffer .= sprintf(
' - %s (%d test%s)' . PHP_EOL,
$group,
(string) $group,
$numberOfTests,
$numberOfTests > 1 ? 's' : '',
);
Expand Down
2 changes: 1 addition & 1 deletion src/TextUI/Command/Commands/ListTestsAsXmlCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function execute(): Result

foreach ($groups as $groupName => $testIds) {
$writer->startElement('group');
$writer->writeAttribute('name', $groupName);
$writer->writeAttribute('name', (string) $groupName);

foreach ($testIds as $testId) {
$writer->startElement('test');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ public function testTwo(): void
{
$this->assertTrue(true);
}

#[Group('3')]
public function testThree(): void
{
$this->assertTrue(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ require_once __DIR__ . '/../../../bootstrap.php';
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Available test group:
Available test groups:
- 3 (1 test)
- two (1 test)
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ require_once __DIR__ . '/../../../bootstrap.php';
PHPUnit %s by Sebastian Bergmann and contributors.

Available test groups:
- 3 (1 test)
- default (1 test)
- two (1 test)
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ require_once __DIR__ . '/../../../bootstrap.php';
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Available test group:
Available test groups:
- 3 (1 test)
- two (1 test)
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require_once __DIR__ . '/../../../bootstrap.php';
PHPUnit %s by Sebastian Bergmann and contributors.

Available test groups:
- 3 (1 test)
- default (1 test)
- one (1 test)
- two (1 test)
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ require_once __DIR__ . '/../../../bootstrap.php';
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Available test:
Available tests:
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ PHPUnit %s by Sebastian Bergmann and contributors.

Available tests:
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree
- %sexample.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ PHPUnit %s by Sebastian Bergmann and contributors.
<tests>
<testClass name="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest" file="%sExampleTest.php">
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo" name="testTwo"/>
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree" name="testThree"/>
</testClass>
</tests>
<groups>
<group name="3">
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree"/>
</group>
<group name="two">
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo"/>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ PHPUnit %s by Sebastian Bergmann and contributors.
<tests>
<testClass name="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest" file="%sExampleTest.php">
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo" name="testTwo"/>
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree" name="testThree"/>
</testClass>
<phpt file="%sexample.phpt"/>
</tests>
<groups>
<group name="3">
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree"/>
</group>
<group name="two">
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo"/>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ PHPUnit %s by Sebastian Bergmann and contributors.
<testClass name="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest" file="%sExampleTest.php">
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne" name="testOne"/>
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo" name="testTwo"/>
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree" name="testThree"/>
</testClass>
<phpt file="%sexample.phpt"/>
</tests>
<groups>
<group name="3">
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree"/>
</group>
<group name="one">
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne"/>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ PHPUnit %s by Sebastian Bergmann and contributors.
Available tests:
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree
- %sexample.phpt

0 comments on commit 4366435

Please sign in to comment.