Skip to content

Commit b13a3b7

Browse files
committed
Upgrade phpunit to version ^10.5
1 parent 73e9afd commit b13a3b7

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ build/
44
raw-tests/
55
vendor/
66
.php-cs-fixer.cache
7+
.phpunit.cache
78
.phpunit.result.cache
89
composer.lock
910
composer.phar

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"jetbrains/phpstorm-attributes": "^1.0",
6969
"phpmd/phpmd": "^2.13",
7070
"phpstan/phpstan": "^1.9",
71-
"phpunit/phpunit": "^9.5"
71+
"phpunit/phpunit": "^10.5"
7272
},
7373
"minimum-stability": "dev",
7474
"prefer-stable": true,

phpunit.xml.dist

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false"
3-
bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true"
4-
convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnError="false"
5-
stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false"
6-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
7-
<coverage processUncoveredFiles="true">
8-
<include>
9-
<directory suffix=".php">src</directory>
10-
</include>
3+
bootstrap="vendor/autoload.php" colors="true" stopOnError="false" stopOnFailure="false"
4+
stopOnIncomplete="false" stopOnSkipped="false"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
6+
cacheDirectory=".phpunit.cache">
7+
<coverage>
118
<report>
129
<clover outputFile="build/coverage/clover.xml"/>
1310
<html outputDirectory="build/coverage"/>
@@ -28,4 +25,9 @@
2825
<env name="REDIS_HOST" value="redis"/>
2926
<env name="XDEBUG_MODE" value="coverage"/>
3027
</php>
28+
<source>
29+
<include>
30+
<directory suffix=".php">src</directory>
31+
</include>
32+
</source>
3133
</phpunit>

tests/LanguagesTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
*/
1919
final class LanguagesTest extends TestCase
2020
{
21-
protected string $langDir = __DIR__ . '/../src/Languages/';
21+
protected static string $langDir = __DIR__ . '/../src/Languages/';
2222

2323
/**
2424
* @return array<int,string>
2525
*/
2626
protected function getCodes() : array
2727
{
2828
// @phpstan-ignore-next-line
29-
$codes = \array_filter((array) \glob($this->langDir . '*'), 'is_dir');
30-
$length = \strlen($this->langDir);
29+
$codes = \array_filter((array) \glob(self::$langDir . '*'), 'is_dir');
30+
$length = \strlen(self::$langDir);
3131
$result = [];
3232
foreach ($codes as &$dir) {
3333
if ($dir === false) {
@@ -47,7 +47,7 @@ protected function getCodes() : array
4747
public function testKeys(array $rules, string $file) : void
4848
{
4949
foreach ($this->getCodes() as $code) {
50-
$lines = require $this->langDir . $code . '/' . $file . '.php';
50+
$lines = require self::$langDir . $code . '/' . $file . '.php';
5151
$lines = \array_keys($lines);
5252
\sort($lines);
5353
self::assertSame($rules, $lines, 'File: ' . $file . '. Language: ' . $code);
@@ -57,15 +57,15 @@ public function testKeys(array $rules, string $file) : void
5757
/**
5858
* @return array<string,array<mixed>>
5959
*/
60-
public function languageProvider() : array
60+
public static function languageProvider() : array
6161
{
6262
$files = [
6363
'validation',
6464
];
6565
$data = [];
6666
foreach ($files as $file) {
6767
$data[$file] = [
68-
\array_keys(require $this->langDir . 'en/' . $file . '.php'),
68+
\array_keys(require self::$langDir . 'en/' . $file . '.php'),
6969
$file,
7070
];
7171
}

0 commit comments

Comments
 (0)