Skip to content

Commit ef94617

Browse files
committed
1 parent 94cbc3a commit ef94617

13 files changed

+64
-2
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@
110110
"tests/_files/CoverageNamespacedFunctionTest.php",
111111
"tests/_files/CoveredFunction.php",
112112
"tests/_files/Generator.php",
113-
"tests/_files/NamespaceCoveredFunction.php"
113+
"tests/_files/NamespaceCoveredFunction.php",
114+
"tests/end-to-end/_files/listing-tests-and-groups/ExampleAbstractTestCase.php"
114115
]
115116
},
116117
"extra": {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
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\TestFixture\ListingTestsAndGroups;
11+
12+
use PHPUnit\Framework\Attributes\Group;
13+
use PHPUnit\Framework\TestCase;
14+
15+
abstract class ExampleAbstractTestCase extends TestCase
16+
{
17+
#[Group('abstract-one')]
18+
public function testOne(): void
19+
{
20+
$this->assertTrue(true);
21+
}
22+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
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\TestFixture\ListingTestsAndGroups;
11+
12+
final class ExampleExtendingAbstractTest extends ExampleAbstractTestCase
13+
{
14+
}

tests/end-to-end/cli/list-test-files/list-test-files-exclude-group.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ require_once __DIR__ . '/../../../bootstrap.php';
1414
PHPUnit %s by Sebastian Bergmann and contributors.
1515

1616
Available test files:
17+
- %slisting-tests-and-groups%sExampleExtendingAbstractTest.php
1718
- %slisting-tests-and-groups%sExampleTest.php
1819
- %slisting-tests-and-groups%sexample.phpt

tests/end-to-end/cli/list-test-files/list-test-files.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ require_once __DIR__ . '/../../../bootstrap.php';
1212
PHPUnit %s by Sebastian Bergmann and contributors.
1313

1414
Available test files:
15+
- %slisting-tests-and-groups%sExampleExtendingAbstractTest.php
1516
- %slisting-tests-and-groups%sExampleTest.php
1617
- %slisting-tests-and-groups%sexample.phpt

tests/end-to-end/cli/listing-tests-and-groups/list-groups-exclude-group.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors.
1717

1818
Available test groups:
1919
- 3 (1 test)
20+
- abstract-one (1 test)
2021
- default (1 test)
2122
- two (1 test)

tests/end-to-end/cli/listing-tests-and-groups/list-groups.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors.
1515

1616
Available test groups:
1717
- 3 (1 test)
18+
- abstract-one (1 test)
1819
- default (1 test)
1920
- one (1 test)
2021
- two (1 test)

tests/end-to-end/cli/listing-tests-and-groups/list-tests-exclude-group.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ require_once __DIR__ . '/../../../bootstrap.php';
1616
PHPUnit %s by Sebastian Bergmann and contributors.
1717

1818
Available tests:
19+
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne
1920
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo
2021
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree
2122
- %sexample.phpt

tests/end-to-end/cli/listing-tests-and-groups/list-tests-include-filter.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ require_once __DIR__ . '/../../../bootstrap.php';
1515
--EXPECTF--
1616
PHPUnit %s by Sebastian Bergmann and contributors.
1717

18-
Available test:
18+
Available tests:
19+
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne
1920
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne

tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-exclude-group.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.
1919
<?xml version="1.0"?>
2020
<testSuite xmlns="https://xml.phpunit.de/testSuite">
2121
<tests>
22+
<testClass name="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest" file="%ExampleExtendingAbstractTest.php">
23+
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne" name="testOne"/>
24+
</testClass>
2225
<testClass name="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest" file="%sExampleTest.php">
2326
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo" name="testTwo"/>
2427
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree" name="testThree"/>
@@ -29,6 +32,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.
2932
<group name="3">
3033
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree"/>
3134
</group>
35+
<group name="abstract-one">
36+
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne"/>
37+
</group>
3238
<group name="two">
3339
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo"/>
3440
</group>

tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-include-filter.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@ PHPUnit %s by Sebastian Bergmann and contributors.
1919
<?xml version="1.0"?>
2020
<testSuite xmlns="https://xml.phpunit.de/testSuite">
2121
<tests>
22+
<testClass name="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest" file="%ExampleExtendingAbstractTest.php">
23+
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne" name="testOne"/>
24+
</testClass>
2225
<testClass name="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest" file="%sExampleTest.php">
2326
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne" name="testOne"/>
2427
</testClass>
2528
</tests>
2629
<groups>
30+
<group name="abstract-one">
31+
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne"/>
32+
</group>
2733
<group name="one">
2834
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne"/>
2935
</group>

tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.
1818
<?xml version="1.0"?>
1919
<testSuite xmlns="https://xml.phpunit.de/testSuite">
2020
<tests>
21+
<testClass name="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest" file="%ExampleExtendingAbstractTest.php">
22+
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne" name="testOne"/>
23+
</testClass>
2124
<testClass name="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest" file="%sExampleTest.php">
2225
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne" name="testOne"/>
2326
<testMethod id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo" name="testTwo"/>
@@ -29,6 +32,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.
2932
<group name="3">
3033
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree"/>
3134
</group>
35+
<group name="abstract-one">
36+
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne"/>
37+
</group>
3238
<group name="one">
3339
<test id="PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne"/>
3440
</group>

tests/end-to-end/cli/listing-tests-and-groups/list-tests.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ require_once __DIR__ . '/../../../bootstrap.php';
1414
PHPUnit %s by Sebastian Bergmann and contributors.
1515

1616
Available tests:
17+
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne
1718
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne
1819
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo
1920
- PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree

0 commit comments

Comments
 (0)