Skip to content

Commit 96a3d2d

Browse files
authored
Merge pull request #455 from cakephp/phpunit-11
Allow phpunit 11
2 parents 2046a0e + b4b0211 commit 96a3d2d

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

.phive/phars.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="phpstan" version="1.10.22" installed="1.10.22" location="./tools/phpstan" copy="false"/>
4-
<phar name="psalm" version="5.13.1" installed="5.13.1" location="./tools/psalm" copy="false"/>
3+
<phar name="phpstan" version="1.11.7" installed="1.11.7" location="./tools/phpstan" copy="false"/>
4+
<phar name="psalm" version="5.25.0" installed="5.25.0" location="./tools/psalm" copy="false"/>
55
</phive>

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"require-dev": {
3232
"cakephp/cakephp-codesniffer": "^5.0",
33-
"phpunit/phpunit": "^10.1.0"
33+
"phpunit/phpunit": "^10.1.0 || ^11.1.3"
3434
},
3535
"provide": {
3636
"psr/clock-implementation": "1.0"

phpstan.neon

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
parameters:
22
level: 8
3-
checkMissingIterableValueType: false
4-
checkGenericClassInNonGenericObjectType: false
53
treatPhpDocTypesAsCertain: false
64
bootstrapFiles:
75
- tests/bootstrap.php
86
paths:
97
- src/
8+
ignoreErrors:
9+
- identifier: missingType.iterableValue

tests/TestCase/Date/ConstructTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use DateTimeImmutable;
2121
use DateTimeZone;
2222
use InvalidArgumentException;
23+
use PHPUnit\Framework\Attributes\DataProvider;
2324

2425
/**
2526
* Test constructors for Date objects.
@@ -68,9 +69,9 @@ public static function inputTimeProvider()
6869
}
6970

7071
/**
71-
* @dataProvider inputTimeProvider
7272
* @return void
7373
*/
74+
#[DataProvider('inputTimeProvider')]
7475
public function testConstructWithTimeParts($time)
7576
{
7677
$date = new ChronosDate($time);

tests/TestCase/Date/DiffTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Cake\Chronos\Test\TestCase\TestCase;
2020
use Closure;
2121
use DatePeriod;
22+
use PHPUnit\Framework\Attributes\DataProvider;
2223

2324
class DiffTest extends TestCase
2425
{
@@ -322,9 +323,9 @@ public static function diffForHumansProvider()
322323
}
323324

324325
/**
325-
* @dataProvider diffForHumansProvider
326326
* @return void
327327
*/
328+
#[DataProvider('diffForHumansProvider')]
328329
public function testDiffForHumansRelative($now, $date, $expected)
329330
{
330331
$this->assertSame($expected, $now->diffForHumans($date));

tests/TestCase/DateTime/DiffTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Closure;
2121
use DatePeriod;
2222
use DateTimeZone;
23+
use PHPUnit\Framework\Attributes\DataProvider;
2324

2425
class DiffTest extends TestCase
2526
{
@@ -584,9 +585,9 @@ public static function diffForHumansProvider()
584585
}
585586

586587
/**
587-
* @dataProvider diffForHumansProvider
588588
* @return void
589589
*/
590+
#[DataProvider('diffForHumansProvider')]
590591
public function testDiffForHumansRelative($now, $date, $expected)
591592
{
592593
$this->assertSame($expected, $now->diffForHumans($date));

tests/TestCase/DateTime/StringsTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Cake\Chronos\Chronos;
1919
use Cake\Chronos\Test\TestCase\TestCase;
2020
use DateTime;
21+
use PHPUnit\Framework\Attributes\DataProvider;
2122

2223
class StringsTest extends TestCase
2324
{
@@ -180,9 +181,9 @@ public static function toQuarterProvider()
180181
/**
181182
* testToQuarter method
182183
*
183-
* @dataProvider toQuarterProvider
184184
* @return void
185185
*/
186+
#[DataProvider('toQuarterProvider')]
186187
public function testToQuarter($date, $expected, $range = false)
187188
{
188189
$this->assertSame($expected, (new Chronos($date))->toQuarter($range));
@@ -206,9 +207,9 @@ public static function toWeekProvider()
206207
/**
207208
* testToWeek method
208209
*
209-
* @dataProvider toWeekProvider
210210
* @return void
211211
*/
212+
#[DataProvider('toWeekProvider')]
212213
public function testToWeek($date, $expected)
213214
{
214215
$this->assertSame($expected, (new Chronos($date))->toWeek());

0 commit comments

Comments
 (0)