Skip to content

Commit f533c26

Browse files
authored
Upgrade to PHPUnit 11 (#76)
* Remove NamespaceSniff, we are way past PHPUnit 6 * Replace @Covers with attributes * Remove AtCovers sniffs * Add typehints to const * Drop PHP 8.1 and 8.2 support, add 8.4 and 8.5 * Upgrade tot PHPUnit 11 * Updated deprecated syntax * Remove referenced deprecated sniffs
1 parent 4eff317 commit f533c26

58 files changed

Lines changed: 52 additions & 993 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
php-versions: ['8.1','8.2','8.3']
15+
php-versions: ['8.3','8.4','8.5']
1616
name: PHP ${{ matrix.php-versions }}
1717
steps:
1818
- uses: actions/checkout@v2

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards. Hostnet version",
55
"license": "MIT",
66
"require": {
7-
"php": "^8.1",
7+
"php": "^8.3",
88
"composer-plugin-api": "^2.0.0",
99
"hostnet/path-composer-plugin-lib": "^1.0.5",
1010
"slevomat/coding-standard": "^8.6.2",
@@ -13,7 +13,7 @@
1313
},
1414
"require-dev": {
1515
"composer/composer": "^2.1.14",
16-
"phpunit/phpunit": "^9.5.10"
16+
"phpunit/phpunit": "^11.5.55"
1717
},
1818
"autoload": {
1919
"psr-0": {

phpunit.xml.dist

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" colors="true" bootstrap="vendor/squizlabs/php_codesniffer/tests/bootstrap.php">
3-
<coverage>
4-
<include>
5-
<directory>./src</directory>
6-
</include>
7-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" colors="true" bootstrap="vendor/squizlabs/php_codesniffer/tests/bootstrap.php">
83
<testsuites>
94
<testsuite name="hostnet/phpcs-tool test suite">
105
<directory>./test/</directory>
6+
<exclude>./test/Hostnet/Tests/AbstractSniffUnitTest.php</exclude>
7+
<exclude>./test/Hostnet/Tests/CopiedAbstractSniffUnitTest.php</exclude>
118
</testsuite>
129
</testsuites>
10+
<source>
11+
<include>
12+
<directory>./src</directory>
13+
</include>
14+
</source>
1315
</phpunit>

src/Hostnet/Sniffs/Classes/CopyrightMustBeBeforeDeclareSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class CopyrightMustBeBeforeDeclareSniff implements Sniff
1313
{
14-
private const ERROR = 'declare(strict_types=1) should be after the copyright statement';
14+
private const string ERROR = 'declare(strict_types=1) should be after the copyright statement';
1515

1616
/**
1717
* {@inheritdoc}

src/Hostnet/Sniffs/Classes/VariableAndPropertyMustBeInSnakeCaseSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
class VariableAndPropertyMustBeInSnakeCaseSniff implements Sniff
1616
{
17-
private const SUPER_GLOBALS = [
17+
private const array SUPER_GLOBALS = [
1818
'GLOBALS',
1919
'_SERVER',
2020
'_GET',

src/Hostnet/Sniffs/Commenting/AtCoversCounterPartSniff.php

Lines changed: 0 additions & 145 deletions
This file was deleted.

src/Hostnet/Sniffs/Commenting/AtCoversFullyQualifiedNameSniff.php

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/Hostnet/Sniffs/Declares/StrictSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
*/
1616
class StrictSniff implements Sniff
1717
{
18-
private const ERROR = 'declare(strict_types = 1) not found';
18+
private const string ERROR = 'declare(strict_types = 1) not found';
1919

20-
private const R_VALUE = [
20+
private const array R_VALUE = [
2121
T_LNUMBER, //integers
2222
T_STRING, //identifiers
2323
T_NUM_STRING, // numeric array index inside string

src/Hostnet/Sniffs/PhpUnit/NamespaceSniff.php

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)