From 4274d1960178856f5bf8d942fe11f44b21ab550c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lanvin?= <1701590+rlanvin@users.noreply.github.com> Date: Sun, 23 Jun 2024 21:25:36 +0200 Subject: [PATCH] Upgrade to PHPUnit 9 --- README.md | 2 +- composer.json | 2 +- tests/RRuleTest.php | 8 ++++++-- tests/RSetTest.php | 9 ++++++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c1f2cfc..eeda244 100755 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Complete documentation and more examples are available in [the wiki](https://git ## Requirements -- PHP >= 5.6 +- PHP >= 7.3 - [intl extension](http://php.net/manual/en/book.intl.php) is recommended for `humanReadable()` but not strictly required ## Installation diff --git a/composer.json b/composer.json index d7e51ea..8345a52 100755 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } }, "require-dev": { - "phpunit/phpunit": "^8.0", + "phpunit/phpunit": "^9.0", "phpmd/phpmd" : "@stable" } } diff --git a/tests/RRuleTest.php b/tests/RRuleTest.php index bb4d3c5..37ff604 100644 --- a/tests/RRuleTest.php +++ b/tests/RRuleTest.php @@ -2245,8 +2245,12 @@ public function quirkyRfcStrings() */ public function testQuirkyRfcStringsParserNotice($str,$occurrences) { - $this->expectException(\PHPUnit\Framework\Error\Notice::class); - $rule = new RRule($str); + try { + $rule = new RRule($str); + $this->fail("Expected an notice, didn't get one"); + } catch (\PHPUnit\Framework\Error\Notice $e) { + $this->assertStringContainsString("This string is not compliant with the RFC (DTSTART cannot be part of RRULE).", $e->getMessage()); + } } /** diff --git a/tests/RSetTest.php b/tests/RSetTest.php index 09c8f73..55a3e17 100755 --- a/tests/RSetTest.php +++ b/tests/RSetTest.php @@ -858,9 +858,12 @@ public function quirkyRfcStrings() */ public function testParseQuirkyRfcStringNotice($string, $occurrences) { - $this->expectException(\PHPUnit\Framework\Error\Notice::class); - - $object = new RSet($string); + try { + $object = new RSet($string); + $this->fail("Expected an notice, didn't get one"); + } catch (\PHPUnit\Framework\Error\Notice $e) { + $this->assertStringContainsString("This string is not compliant with the RFC (DTSTART cannot be part of RRULE).", $e->getMessage()); + } } /**