Skip to content

Commit

Permalink
Allow phpunit 11
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jul 14, 2024
1 parent 2046a0e commit a3bc7c1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
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
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 a3bc7c1

Please sign in to comment.