From 70819386d20c14ea77b63a32808aa8e03ac62ef8 Mon Sep 17 00:00:00 2001 From: Alexandr Smirnov Date: Tue, 11 Jun 2024 18:04:41 +0300 Subject: [PATCH] Fix test for PHP 7.3 --- .github/workflows/test.yml | 2 +- composer.json | 2 +- .../unittest/classes/Kohana/Unittest/TestCase.php | 7 ++++--- system/tests/kohana/DateTest.php | 14 +++++++------- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd75990..597b822 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - php-versions: ['5.6', '7.0', '7.1'] + php-versions: ['5.6', '7.0', '7.1','7.2','7.3'] services: memcached: diff --git a/composer.json b/composer.json index 40eeee1..9d0f6db 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.6,<7.2", + "php": ">=5.6,<=7.3.34", "ext-mbstring": "*" }, "require-dev": { diff --git a/modules/unittest/classes/Kohana/Unittest/TestCase.php b/modules/unittest/classes/Kohana/Unittest/TestCase.php index 8fdc9de..dca71d1 100644 --- a/modules/unittest/classes/Kohana/Unittest/TestCase.php +++ b/modules/unittest/classes/Kohana/Unittest/TestCase.php @@ -137,9 +137,10 @@ public static function assertNotTag($matcher, $actual, $message = '', $isHtml = { $dom = PHPUnit_Util_XML::load($actual, $isHtml); $tags = static::findNodes($dom, $matcher, $isHtml); - $matched = count($tags) > 0 && $tags[0] instanceof DOMNode; - - self::assertFalse($matched, $message); + if (is_array($tags)) { + $matched = count($tags) > 0 && $tags[0] instanceof DOMNode; + self::assertFalse($matched, $message); + } } /** diff --git a/system/tests/kohana/DateTest.php b/system/tests/kohana/DateTest.php index cb23f48..cb53ed8 100644 --- a/system/tests/kohana/DateTest.php +++ b/system/tests/kohana/DateTest.php @@ -56,7 +56,7 @@ public function tearDown() public function provider_offset() { return [ - [30600, 'Asia/Calcutta', 'America/Argentina/Buenos_Aires'], + [30600, 'Asia/Kolkata', 'America/Argentina/Buenos_Aires'], ]; } @@ -262,22 +262,22 @@ public function provider_formatted_time() ], // Timezones (see #3902) [ - '2011-04-01 01:23:45 Antarctica/South_Pole', + '2011-04-01 01:23:45 Pacific/Auckland', '2011-04-01 01:23:45', 'Y-m-d H:i:s e', - 'Antarctica/South_Pole' + 'Pacific/Auckland' ], [ - '2011-04-01 01:23:45 Antarctica/South_Pole', + '2011-04-01 01:23:45 Pacific/Auckland', '2011-03-31 14:23:45 Europe/Paris', 'Y-m-d H:i:s e', - 'Antarctica/South_Pole' + 'Pacific/Auckland' ], [ - '2011-04-01 01:23:45 Antarctica/South_Pole', + '2011-04-01 01:23:45 Pacific/Auckland', '@1301574225', 'Y-m-d H:i:s e', - 'Antarctica/South_Pole' + 'Pacific/Auckland' ], ]; }