Skip to content

Commit

Permalink
ci: migrate phpunit config (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod authored Feb 16, 2024
1 parent f805718 commit da27238
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"phpstan/phpstan": "^1.0.0",
"phpstan/phpstan-phpunit": "^1.0.0",
"phpstan/phpstan-strict-rules": "^1.0.0",
"phpunit/phpunit": "^10.0"
"phpunit/phpunit": "^10.1"
},
"config": {
"allow-plugins": {
Expand Down
27 changes: 19 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
colors="true"
bootstrap="tests/bootstrap.php"
colors="true"
requireCoverageMetadata="true"
failOnRisky="true"
cacheDirectory=".phpunit.cache"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerWarnings="true"
failOnWarning="true"
failOnIncomplete="true"
failOnEmptyTestSuite="true"
>
<coverage>
<testsuites>
<testsuite name="Tests">
<directory>tests</directory>
</testsuite>
</testsuites>

<source>
<include>
<directory suffix=".php">src/</directory>
<directory>./src</directory>
</include>
</coverage>
<testsuite name="Cdn77 Coding Standard">
<directory>tests</directory>
</testsuite>
</source>
</phpunit>
2 changes: 2 additions & 0 deletions tests/Sniffs/NamingConventions/ValidConstantNameSniffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
namespace Cdn77\Sniffs\NamingConventions;

use Cdn77\TestCase;
use PHPUnit\Framework\Attributes\CoversClass;

use function array_keys;
use function count;
use function json_encode;

use const JSON_THROW_ON_ERROR;

#[CoversClass(ValidConstantNameSniff::class)]
class ValidConstantNameSniffTest extends TestCase
{
public function testErrors(): void
Expand Down
2 changes: 2 additions & 0 deletions tests/Sniffs/NamingConventions/ValidVariableNameSniffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
namespace Cdn77\Sniffs\NamingConventions;

use Cdn77\TestCase;
use PHPUnit\Framework\Attributes\CoversClass;

use function array_keys;
use function is_array;
use function json_encode;

use const JSON_THROW_ON_ERROR;

#[CoversClass(ValidVariableNameSniff::class)]
class ValidVariableNameSniffTest extends TestCase
{
public function testErrors(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
namespace Cdn77\Sniffs\Ordering;

use Cdn77\TestCase;
use PHPUnit\Framework\Attributes\CoversClass;

use function array_keys;
use function json_encode;

use const JSON_THROW_ON_ERROR;

#[CoversClass(AlphabeticallyOrderedConstantsSniff::class)]
final class AlphabeticallyOrderedConstantsSniffTest extends TestCase
{
public function testErrors(): void
Expand Down

0 comments on commit da27238

Please sign in to comment.