From dc1514deec49efa41e6b5db677484422871d2cad Mon Sep 17 00:00:00 2001 From: Nils L Date: Tue, 2 Jul 2024 16:44:04 +0200 Subject: [PATCH] Explicit declaration of properties in class that were created dynamically. (#1607) From PHP 8.2 it is deprecated to dynamically declare properties for objects, so declare them in class definition. --- tests/php/Repository/TimeframeTest.php | 5 ++++- tests/php/Service/BookingRuleAppliedTest.php | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/php/Repository/TimeframeTest.php b/tests/php/Repository/TimeframeTest.php index 6a7fa4177..b0f5d2004 100644 --- a/tests/php/Repository/TimeframeTest.php +++ b/tests/php/Repository/TimeframeTest.php @@ -18,6 +18,9 @@ class TimeframeTest extends CustomPostTypeTest { protected int $timeframeDailyRepetition; protected int $timeframeWeeklyRepetition; protected int $timeframeManualRepetition; + protected int $otherItemId; + protected int $otherLocationId; + protected int $otherTimeframeId; /** * The tests are designed in a way, that all timeframes should lie in the CURRENT_DATE plus 10 days. @@ -482,7 +485,7 @@ public function testGetPostIdsByType_oneLocationMultiItem() { */ public function testGetPostIdsByType_multiLocationMultiItem() { // Timeframe with enddate and one item - $this->timeframeId = $this->createTimeframe( + $timeframeId = $this->createTimeframe( $this->locationId, $this->itemId, $this->repetition_start, diff --git a/tests/php/Service/BookingRuleAppliedTest.php b/tests/php/Service/BookingRuleAppliedTest.php index f5e7be986..73d8b1793 100644 --- a/tests/php/Service/BookingRuleAppliedTest.php +++ b/tests/php/Service/BookingRuleAppliedTest.php @@ -14,6 +14,8 @@ class BookingRuleAppliedTest extends CustomPostTypeTest { private Booking $testBookingTomorrow; private int $testBookingId; protected BookingRuleApplied $appliedAlwaysAllow,$appliedAlwaysDeny; + protected BookingRule $alwaysallow; + protected BookingRule $alwaysdeny; protected function setUpTestBooking(): void { $this->testBookingId = $this->createBooking(