From b4337c893521e4b0d828f9eec49fb39f086ae41a 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:05:14 +0200 Subject: [PATCH] Drop support for PHP < 7.3 Ref #119 --- .github/workflows/tests.yml | 6 +++--- composer.json | 4 ++-- phpunit.xml.dist | 1 - tests/RRuleTest.php | 6 +++--- tests/RSetTest.php | 8 ++++---- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9731094..ad6d302 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,11 +7,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + php: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] name: PHP ${{ matrix.php }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -26,7 +26,7 @@ jobs: - name: Cache Composer packages id: composer-cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: vendor key: ${{ matrix.php }}-composer diff --git a/composer.json b/composer.json index 3771d12..d7e51ea 100755 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "homepage": "https://github.com/rlanvin/php-rrule", "license": "MIT", "require": { - "php": ">=5.6.0" + "php": ">=7.3" }, "suggest": { "ext-intl": "Intl extension is needed for humanReadable()" @@ -22,7 +22,7 @@ } }, "require-dev": { - "phpunit/phpunit": "^5.7|^6.5|^8.0", + "phpunit/phpunit": "^8.0", "phpmd/phpmd" : "@stable" } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 595f769..7e0fa61 100755 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,6 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" bootstrap="./tests/bootstrap.php" > diff --git a/tests/RRuleTest.php b/tests/RRuleTest.php index 50e49ae..bb4d3c5 100644 --- a/tests/RRuleTest.php +++ b/tests/RRuleTest.php @@ -2257,7 +2257,7 @@ public function testQuirkyRfcStringsParser($str,$occurrences) $rule = @ new RRule($str); if ($occurrences) { - $this->assertEquals($occurrences, $rule->getOccurrences(), '', 1); + $this->assertEquals($occurrences, $rule->getOccurrences()); } } @@ -2803,10 +2803,10 @@ public function testGetRule() 'DTSTART' => '2016-01-01' ); $rrule = new RRule($array); - $this->assertInternalType('array', $rrule->getRule()); + $this->assertIsArray($rrule->getRule()); $rule = $rrule->getRule(); $this->assertEquals('YEARLY', $rule['FREQ']); - $this->assertInternalType('string', $rule['DTSTART']); + $this->assertIsString($rule['DTSTART']); $rrule = new RRule("DTSTART;TZID=America/New_York:19970901T090000\nRRULE:FREQ=HOURLY;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,WE,FR;BYMONTH=1;BYHOUR=1"); $rule = $rrule->getRule(); diff --git a/tests/RSetTest.php b/tests/RSetTest.php index b606636..09c8f73 100755 --- a/tests/RSetTest.php +++ b/tests/RSetTest.php @@ -591,13 +591,13 @@ public function testGetter() 'DTSTART' => date_create('1997-09-02 09:00') )); - $this->assertInternalType('array', $rset->getRRules()); + $this->assertIsArray($rset->getRRules()); $this->assertCount(2, $rset->getRRules()); - $this->assertInternalType('array', $rset->getExRules()); + $this->assertIsArray($rset->getExRules()); $this->assertCount(1, $rset->getExRules()); - $this->assertInternalType('array', $rset->getDates()); + $this->assertIsArray($rset->getDates()); $this->assertCount(3, $rset->getDates()); - $this->assertInternalType('array', $rset->getExDates()); + $this->assertIsArray($rset->getExDates()); $this->assertCount(0, $rset->getExDates()); }