Skip to content

Commit da27238

Browse files
authored
ci: migrate phpunit config (#138)
1 parent f805718 commit da27238

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"phpstan/phpstan": "^1.0.0",
2525
"phpstan/phpstan-phpunit": "^1.0.0",
2626
"phpstan/phpstan-strict-rules": "^1.0.0",
27-
"phpunit/phpunit": "^10.0"
27+
"phpunit/phpunit": "^10.1"
2828
},
2929
"config": {
3030
"allow-plugins": {

phpunit.xml.dist

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
55
beStrictAboutChangesToGlobalState="true"
66
beStrictAboutOutputDuringTests="true"
77
beStrictAboutTodoAnnotatedTests="true"
8-
colors="true"
98
bootstrap="tests/bootstrap.php"
9+
colors="true"
10+
requireCoverageMetadata="true"
11+
failOnRisky="true"
12+
cacheDirectory=".phpunit.cache"
13+
displayDetailsOnTestsThatTriggerDeprecations="true"
14+
displayDetailsOnTestsThatTriggerWarnings="true"
15+
failOnWarning="true"
16+
failOnIncomplete="true"
17+
failOnEmptyTestSuite="true"
1018
>
11-
<coverage>
19+
<testsuites>
20+
<testsuite name="Tests">
21+
<directory>tests</directory>
22+
</testsuite>
23+
</testsuites>
24+
25+
<source>
1226
<include>
13-
<directory suffix=".php">src/</directory>
27+
<directory>./src</directory>
1428
</include>
15-
</coverage>
16-
<testsuite name="Cdn77 Coding Standard">
17-
<directory>tests</directory>
18-
</testsuite>
29+
</source>
1930
</phpunit>

tests/Sniffs/NamingConventions/ValidConstantNameSniffTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
namespace Cdn77\Sniffs\NamingConventions;
66

77
use Cdn77\TestCase;
8+
use PHPUnit\Framework\Attributes\CoversClass;
89

910
use function array_keys;
1011
use function count;
1112
use function json_encode;
1213

1314
use const JSON_THROW_ON_ERROR;
1415

16+
#[CoversClass(ValidConstantNameSniff::class)]
1517
class ValidConstantNameSniffTest extends TestCase
1618
{
1719
public function testErrors(): void

tests/Sniffs/NamingConventions/ValidVariableNameSniffTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
namespace Cdn77\Sniffs\NamingConventions;
66

77
use Cdn77\TestCase;
8+
use PHPUnit\Framework\Attributes\CoversClass;
89

910
use function array_keys;
1011
use function is_array;
1112
use function json_encode;
1213

1314
use const JSON_THROW_ON_ERROR;
1415

16+
#[CoversClass(ValidVariableNameSniff::class)]
1517
class ValidVariableNameSniffTest extends TestCase
1618
{
1719
public function testErrors(): void

tests/Sniffs/Ordering/AlphabeticallyOrderedConstantsSniffTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
namespace Cdn77\Sniffs\Ordering;
66

77
use Cdn77\TestCase;
8+
use PHPUnit\Framework\Attributes\CoversClass;
89

910
use function array_keys;
1011
use function json_encode;
1112

1213
use const JSON_THROW_ON_ERROR;
1314

15+
#[CoversClass(AlphabeticallyOrderedConstantsSniff::class)]
1416
final class AlphabeticallyOrderedConstantsSniffTest extends TestCase
1517
{
1618
public function testErrors(): void

0 commit comments

Comments
 (0)