Skip to content

Commit 8116e70

Browse files
authored
⬆️ PHPUnit 11 (#85)
1 parent 19ca952 commit 8116e70

26 files changed

+94
-88
lines changed

.github/workflows/workflows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
php-versions: ['8.1', '8.2', '8.3']
8+
php-versions: ['8.2', '8.3']
99
steps:
1010
- uses: actions/checkout@v4
1111
- uses: "shivammathur/setup-php@v2"
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
strategy:
2525
matrix:
26-
php-versions: ['8.1', '8.2', '8.3']
26+
php-versions: ['8.2', '8.3']
2727
steps:
2828
- uses: actions/checkout@v4
2929
- uses: "shivammathur/setup-php@v2"
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-latest
4242
strategy:
4343
matrix:
44-
php-versions: ['8.1', '8.2', '8.3']
44+
php-versions: ['8.2', '8.3']
4545
dependency-versions: ['highest', 'lowest']
4646
steps:
4747
- uses: actions/checkout@v4

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"homepage": "https://github.com/previousnext/coding-standard",
55
"keywords": ["drupal", "phpcs"],
66
"require": {
7-
"php": "^8.1",
7+
"php": "^8.2",
88
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
99
"drupal/coder": "^8.3.24",
1010
"slevomat/coding-standard": "^8.15.0",
@@ -15,7 +15,7 @@
1515
"phpstan/phpstan": "^1.11.3",
1616
"phpstan/phpstan-deprecation-rules": "^1.2.0",
1717
"phpstan/phpstan-strict-rules": "^1.6.0",
18-
"phpunit/phpunit": "^9.6.19"
18+
"phpunit/phpunit": "^11"
1919
},
2020
"license": "MIT",
2121
"autoload": {

phpcs.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
<rule ref="PreviousNextDrupal" />
1111
<arg name="report" value="full"/>
1212

13-
<!-- Most functions are tests, and are self documenting. -->
13+
<!-- Most classes and functions are tests, and are self documenting. -->
14+
<rule ref="Drupal.Commenting.ClassComment.Missing">
15+
<exclude-pattern>./tests/*</exclude-pattern>
16+
</rule>
1417
<rule ref="Drupal.Commenting.FunctionComment.Missing">
1518
<exclude-pattern>./tests/*</exclude-pattern>
1619
</rule>

phpunit.xml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
4-
bootstrap="tests/bootstrap.php"
5-
cacheResultFile=".phpunit.cache/test-results"
6-
executionOrder="depends,defects"
7-
beStrictAboutCoversAnnotation="true"
8-
beStrictAboutOutputDuringTests="true"
9-
beStrictAboutTodoAnnotatedTests="true"
10-
convertDeprecationsToExceptions="true"
11-
failOnRisky="true"
12-
failOnWarning="true"
13-
verbose="true">
14-
<testsuites>
15-
<testsuite name="default">
16-
<directory>tests</directory>
17-
</testsuite>
18-
</testsuites>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd"
5+
bootstrap="tests/bootstrap.php"
6+
executionOrder="depends,defects"
7+
beStrictAboutOutputDuringTests="true"
8+
failOnRisky="true"
9+
failOnWarning="true"
10+
cacheDirectory=".phpunit.cache"
11+
beStrictAboutCoverageMetadata="true"
12+
>
13+
<testsuites>
14+
<testsuite name="default">
15+
<directory>tests</directory>
16+
</testsuite>
17+
</testsuites>
1918
</phpunit>

tests/Ignore/IgnoreDocCommentSniffTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
namespace PreviousNext\CodingStandard\Tests\Ignore;
66

7-
/**
8-
* @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff
9-
*/
7+
use PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff;
8+
use PHPUnit\Framework\Attributes\CoversClass;
9+
10+
#[CoversClass(DocCommentSniff::class)]
1011
final class IgnoreDocCommentSniffTest extends Base {
1112

1213
/**

tests/Ignore/IgnoreDrupalArraysArrayLongLineDeclarationTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
namespace PreviousNext\CodingStandard\Tests\Ignore;
66

7-
/**
8-
* @covers \Drupal\Sniffs\Arrays\ArraySniff
9-
*/
7+
use Drupal\Sniffs\Arrays\ArraySniff;
8+
use PHPUnit\Framework\Attributes\CoversClass;
9+
10+
#[CoversClass(ArraySniff::class)]
1011
final class IgnoreDrupalArraysArrayLongLineDeclarationTest extends Base {
1112

1213
/**

tests/Ignore/IgnoreDrupalCommentingClassCommentShortTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
namespace PreviousNext\CodingStandard\Tests\Ignore;
66

7-
/**
8-
* @covers \Drupal\Sniffs\Commenting\ClassCommentSniff
9-
*/
7+
use Drupal\Sniffs\Commenting\ClassCommentSniff;
8+
use PHPUnit\Framework\Attributes\CoversClass;
9+
10+
#[CoversClass(ClassCommentSniff::class)]
1011
final class IgnoreDrupalCommentingClassCommentShortTest extends Base {
1112

1213
/**

tests/Ignore/IgnoreDrupalCommentingFunctionCommentTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
namespace PreviousNext\CodingStandard\Tests\Ignore;
66

7-
/**
8-
* @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff
9-
*/
7+
use PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff;
8+
use PHPUnit\Framework\Attributes\CoversClass;
9+
10+
#[CoversClass(FunctionCommentSniff::class)]
1011
final class IgnoreDrupalCommentingFunctionCommentTest extends Base {
1112

1213
/**

tests/Ignore/IgnoreDrupalCommentingTodoCommentTodoFormatTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
namespace PreviousNext\CodingStandard\Tests\Ignore;
66

7-
/**
8-
* @covers \Drupal\Sniffs\Commenting\TodoCommentSniff
9-
*/
7+
use Drupal\Sniffs\Commenting\TodoCommentSniff;
8+
use PHPUnit\Framework\Attributes\CoversClass;
9+
10+
#[CoversClass(TodoCommentSniff::class)]
1011
final class IgnoreDrupalCommentingTodoCommentTodoFormatTest extends Base {
1112

1213
/**

tests/Ignore/IgnoreDrupalCommentingVariableCommentMissingTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
namespace PreviousNext\CodingStandard\Tests\Ignore;
66

7-
/**
8-
* @covers \Drupal\Sniffs\Commenting\VariableCommentSniff
9-
*/
7+
use Drupal\Sniffs\Commenting\VariableCommentSniff;
8+
use PHPUnit\Framework\Attributes\CoversClass;
9+
10+
#[CoversClass(VariableCommentSniff::class)]
1011
final class IgnoreDrupalCommentingVariableCommentMissingTest extends Base {
1112

1213
public function testIgnored(): void {

0 commit comments

Comments
 (0)