Skip to content

Commit

Permalink
Merge pull request #455 from cakephp/phpunit-11
Browse files Browse the repository at this point in the history
Allow phpunit 11
  • Loading branch information
dereuromark authored Jul 14, 2024
2 parents 2046a0e + b4b0211 commit 96a3d2d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="1.10.22" installed="1.10.22" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="5.13.1" installed="5.13.1" location="./tools/psalm" copy="false"/>
<phar name="phpstan" version="1.11.7" installed="1.11.7" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="5.25.0" installed="5.25.0" location="./tools/psalm" copy="false"/>
</phive>
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"require-dev": {
"cakephp/cakephp-codesniffer": "^5.0",
"phpunit/phpunit": "^10.1.0"
"phpunit/phpunit": "^10.1.0 || ^11.1.3"
},
"provide": {
"psr/clock-implementation": "1.0"
Expand Down
4 changes: 2 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
parameters:
level: 8
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
treatPhpDocTypesAsCertain: false
bootstrapFiles:
- tests/bootstrap.php
paths:
- src/
ignoreErrors:
- identifier: missingType.iterableValue
3 changes: 2 additions & 1 deletion tests/TestCase/Date/ConstructTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use DateTimeImmutable;
use DateTimeZone;
use InvalidArgumentException;
use PHPUnit\Framework\Attributes\DataProvider;

/**
* Test constructors for Date objects.
Expand Down Expand Up @@ -68,9 +69,9 @@ public static function inputTimeProvider()
}

/**
* @dataProvider inputTimeProvider
* @return void
*/
#[DataProvider('inputTimeProvider')]
public function testConstructWithTimeParts($time)
{
$date = new ChronosDate($time);
Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase/Date/DiffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Cake\Chronos\Test\TestCase\TestCase;
use Closure;
use DatePeriod;
use PHPUnit\Framework\Attributes\DataProvider;

class DiffTest extends TestCase
{
Expand Down Expand Up @@ -322,9 +323,9 @@ public static function diffForHumansProvider()
}

/**
* @dataProvider diffForHumansProvider
* @return void
*/
#[DataProvider('diffForHumansProvider')]
public function testDiffForHumansRelative($now, $date, $expected)
{
$this->assertSame($expected, $now->diffForHumans($date));
Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase/DateTime/DiffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Closure;
use DatePeriod;
use DateTimeZone;
use PHPUnit\Framework\Attributes\DataProvider;

class DiffTest extends TestCase
{
Expand Down Expand Up @@ -584,9 +585,9 @@ public static function diffForHumansProvider()
}

/**
* @dataProvider diffForHumansProvider
* @return void
*/
#[DataProvider('diffForHumansProvider')]
public function testDiffForHumansRelative($now, $date, $expected)
{
$this->assertSame($expected, $now->diffForHumans($date));
Expand Down
5 changes: 3 additions & 2 deletions tests/TestCase/DateTime/StringsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Cake\Chronos\Chronos;
use Cake\Chronos\Test\TestCase\TestCase;
use DateTime;
use PHPUnit\Framework\Attributes\DataProvider;

class StringsTest extends TestCase
{
Expand Down Expand Up @@ -180,9 +181,9 @@ public static function toQuarterProvider()
/**
* testToQuarter method
*
* @dataProvider toQuarterProvider
* @return void
*/
#[DataProvider('toQuarterProvider')]
public function testToQuarter($date, $expected, $range = false)
{
$this->assertSame($expected, (new Chronos($date))->toQuarter($range));
Expand All @@ -206,9 +207,9 @@ public static function toWeekProvider()
/**
* testToWeek method
*
* @dataProvider toWeekProvider
* @return void
*/
#[DataProvider('toWeekProvider')]
public function testToWeek($date, $expected)
{
$this->assertSame($expected, (new Chronos($date))->toWeek());
Expand Down

0 comments on commit 96a3d2d

Please sign in to comment.