Package: davical Version: 1.1.12-2.1 Severity: important Tags: patch Control: block 1099656 by -1 X-Debbugs-Cc: Debian PHP PEAR Maintainers <pkg-php-p...@lists.alioth.debian.org>
Hi, Please consider applying the attached patch in order to allow PHPUnit 12, currently in experimental, to be uploaded to unstable before the freeze. The syntax change is already compatible with PHPUnit 11 currently in unstable and testing. Thanks in advance. Regards, taffit
From 33deacae4dfd31a111e338f3ee95317a41f8e231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pr=C3=A9vot?= <taf...@debian.org> Date: Thu, 6 Mar 2025 13:19:06 +0100 Subject: [PATCH] Modernize PHPUnit syntax --- testing/phpunit/ExpansionTest.php | 26 ++++++++++---------------- testing/phpunit/RangeTest.php | 26 ++++++++++---------------- 2 files changed, 20 insertions(+), 32 deletions(-) diff --git a/testing/phpunit/ExpansionTest.php b/testing/phpunit/ExpansionTest.php index 7e5bf842..a6ab0b02 100644 --- a/testing/phpunit/ExpansionTest.php +++ b/testing/phpunit/ExpansionTest.php @@ -5,6 +5,8 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/awl/inc' . PA require_once('RRule.php'); require_once('vCalendar.php'); +use PHPUnit\Framework\Attributes\PreserveGlobalState; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; $c = (object) array(); @@ -143,10 +145,8 @@ final class ExpansionTest extends TestCase '20190124T000000Z/20190124T010000Z', ]; - /** - * @runInSeparateProcess - * @preserveGlobalState enabled - */ + #[PreserveGlobalState('enabled')] + #[RunInSeparateProcess] public function testUnmodifiedCal() { global $base_cal; @@ -156,10 +156,8 @@ final class ExpansionTest extends TestCase ); } - /** - * @runInSeparateProcess - * @preserveGlobalState enabled - */ + #[PreserveGlobalState('enabled')] + #[RunInSeparateProcess] public function testTueRenamed() { global $tuesday_renamed_cal; @@ -169,10 +167,8 @@ final class ExpansionTest extends TestCase ); } - /** - * @runInSeparateProcess - * @preserveGlobalState enabled - */ + #[PreserveGlobalState('enabled')] + #[RunInSeparateProcess] public function testTueRenamedSwapped() { global $tuesday_renamed_cal_order_swapped; @@ -182,10 +178,8 @@ final class ExpansionTest extends TestCase ); } - /** - * @runInSeparateProcess - * @preserveGlobalState enabled - */ + #[PreserveGlobalState('enabled')] + #[RunInSeparateProcess] public function testCalWithCount() { global $count_cal; diff --git a/testing/phpunit/RangeTest.php b/testing/phpunit/RangeTest.php index 7c68d7a8..99acb1a2 100644 --- a/testing/phpunit/RangeTest.php +++ b/testing/phpunit/RangeTest.php @@ -5,6 +5,8 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/awl/inc' . PA require_once('RRule.php'); require_once('vCalendar.php'); +use PHPUnit\Framework\Attributes\PreserveGlobalState; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; $c = (object) array(); @@ -12,10 +14,8 @@ $c->rrule_loop_limit = 100; final class RangeTest extends TestCase { - /** - * @runInSeparateProcess - * @preserveGlobalState enabled - */ + #[PreserveGlobalState('enabled')] + #[RunInSeparateProcess] public function testGetVCalendarRange() { $cal = new vCalendar("BEGIN:VCALENDAR PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN @@ -52,10 +52,8 @@ END:VCALENDAR"); self::assertEquals("20190102T072000Z", (string) $range->until->UTC()); } - /** - * @runInSeparateProcess - * @preserveGlobalState enabled - */ + #[PreserveGlobalState('enabled')] + #[RunInSeparateProcess] public function testGetVCalendarRangeTwoDayAllDay() { $cal = new vCalendar("BEGIN:VCALENDAR PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN @@ -78,10 +76,8 @@ END:VCALENDAR"); self::assertEquals("20190109T200000Z", (string) $range->until->UTC()); } - /** - * @runInSeparateProcess - * @preserveGlobalState enabled - */ + #[PreserveGlobalState('enabled')] + #[RunInSeparateProcess] public function testGetVCalendarRangeFloating() { // When interpreted as being in Greece, this event crosses the daylight savings boundary! // TODO deal with how that affects all-day events... @@ -106,10 +102,8 @@ END:VCALENDAR"); self::assertEquals("20181210T130000Z", (string) $range->until->UTC()); } - /** - * @runInSeparateProcess - * @preserveGlobalState enabled - */ + #[PreserveGlobalState('enabled')] + #[RunInSeparateProcess] public function testGetVCalendarRangeAllDayAcrossDST() { // When interpreted as being in Greece, this event crosses the daylight savings boundary! -- 2.47.2
signature.asc
Description: PGP signature