From: Robin Gustafsson <robin@rgson.se>
Date: Thu, 6 Jun 2024 21:58:31 +0200
Subject: Fix PHPUnit 11 compatibility

Upstream is preserving PHP 7 compatibility on version 2.x so PHPUnit 11
won't be supported.

Forwarded: not-needed
---
 tests/AbstractTestCase.php                         |  2 +-
 tests/Carbon/WeekTest.php                          |  4 +-
 tests/CarbonImmutable/WeekTest.php                 |  4 +-
 tests/CarbonPeriod/AliasTest.php                   | 34 ++++++-------
 tests/CarbonPeriod/CloneTest.php                   |  4 +-
 tests/CarbonPeriod/ComparisonTest.php              | 20 ++++----
 tests/CarbonPeriod/CreateTest.php                  | 54 ++++++++++-----------
 tests/CarbonPeriod/DynamicIntervalTest.php         |  2 +-
 tests/CarbonPeriod/FilterTest.php                  | 38 +++++++--------
 tests/CarbonPeriod/GettersTest.php                 | 12 ++---
 tests/CarbonPeriod/IteratorTest.php                | 48 +++++++++----------
 tests/CarbonPeriod/MacroTest.php                   | 34 ++++++-------
 tests/CarbonPeriod/RoundingTest.php                | 10 ++--
 tests/CarbonPeriod/SettersTest.php                 | 56 +++++++++++-----------
 tests/CarbonPeriod/StrictModeTest.php              |  4 +-
 tests/CarbonPeriod/ToArrayTest.php                 | 36 +++++++-------
 tests/CarbonPeriod/ToDatePeriodTest.php            |  8 ++--
 tests/CarbonPeriod/ToStringTest.php                | 16 +++----
 tests/CarbonPeriodImmutable/AliasTest.php          |  2 +-
 tests/CarbonPeriodImmutable/CloneTest.php          |  2 +-
 tests/CarbonPeriodImmutable/ComparisonTest.php     |  2 +-
 tests/CarbonPeriodImmutable/CreateTest.php         |  2 +-
 .../CarbonPeriodImmutable/DynamicIntervalTest.php  |  2 +-
 tests/CarbonPeriodImmutable/FilterTest.php         |  2 +-
 tests/CarbonPeriodImmutable/GettersTest.php        |  2 +-
 .../CarbonPeriodImmutable/IterationMethodsTest.php |  2 +-
 tests/CarbonPeriodImmutable/IteratorTest.php       |  2 +-
 tests/CarbonPeriodImmutable/MacroTest.php          |  2 +-
 tests/CarbonPeriodImmutable/RoundingTest.php       |  2 +-
 tests/CarbonPeriodImmutable/SettersTest.php        |  2 +-
 tests/CarbonPeriodImmutable/StrictModeTest.php     |  2 +-
 tests/CarbonPeriodImmutable/ToArrayTest.php        |  2 +-
 tests/CarbonPeriodImmutable/ToDatePeriodTest.php   |  2 +-
 tests/CarbonPeriodImmutable/ToStringTest.php       |  2 +-
 34 files changed, 209 insertions(+), 209 deletions(-)

diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php
index 321ac4f..edacd75 100644
--- a/tests/AbstractTestCase.php
+++ b/tests/AbstractTestCase.php
@@ -62,7 +62,7 @@ abstract class AbstractTestCase extends TestCase
     /**
      * @var class-string<CarbonPeriod>
      */
-    protected $periodClass = CarbonPeriod::class;
+    protected static $periodClass = CarbonPeriod::class;
 
     protected function getTimestamp()
     {
diff --git a/tests/Carbon/WeekTest.php b/tests/Carbon/WeekTest.php
index 2ffb55d..0f64cc4 100644
--- a/tests/Carbon/WeekTest.php
+++ b/tests/Carbon/WeekTest.php
@@ -5449,7 +5449,7 @@ class WeekTest extends AbstractTestCase
         );
     }
 
-    public function getDaysFromStartOfWeekDataProvider(): array
+    public static function getDaysFromStartOfWeekDataProvider(): array
     {
         return [
             'Monday en_US' => ['en_US', '2022-11-21', 1],
@@ -5489,7 +5489,7 @@ class WeekTest extends AbstractTestCase
         $this->assertSame($daysCount, $carbon->getDaysFromStartOfWeek($start));
     }
 
-    public function getDaysFromStartOfWeekDataProviderExplicit(): array
+    public static function getDaysFromStartOfWeekDataProviderExplicit(): array
     {
         return [
             'Monday 0' => [0, '2022-11-21', 1],
diff --git a/tests/CarbonImmutable/WeekTest.php b/tests/CarbonImmutable/WeekTest.php
index 001a476..4c7af11 100644
--- a/tests/CarbonImmutable/WeekTest.php
+++ b/tests/CarbonImmutable/WeekTest.php
@@ -5443,7 +5443,7 @@ class WeekTest extends AbstractTestCase
         );
     }
 
-    public function getDaysFromStartOfWeekDataProvider(): array
+    public static function getDaysFromStartOfWeekDataProvider(): array
     {
         return [
             'Monday en_US' => ['en_US', '2022-11-21', 1],
@@ -5483,7 +5483,7 @@ class WeekTest extends AbstractTestCase
         $this->assertSame($daysCount, $carbon->getDaysFromStartOfWeek($start));
     }
 
-    public function getDaysFromStartOfWeekDataProviderExplicit(): array
+    public static function getDaysFromStartOfWeekDataProviderExplicit(): array
     {
         return [
             'Monday 0' => [0, '2022-11-21', 1],
diff --git a/tests/CarbonPeriod/AliasTest.php b/tests/CarbonPeriod/AliasTest.php
index ab004a4..dd35282 100644
--- a/tests/CarbonPeriod/AliasTest.php
+++ b/tests/CarbonPeriod/AliasTest.php
@@ -24,7 +24,7 @@ class AliasTest extends AbstractTestCase
 {
     public function testSetStartDate()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::start($date = '2017-09-13 12:30:45', false);
         $this->assertEquals(Carbon::parse($date), $period->getStartDate());
         $this->assertEquals(Carbon::parse($date), $period->start);
@@ -44,7 +44,7 @@ class AliasTest extends AbstractTestCase
      */
     public function testSetStartDateWithNamedParameters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $date = '2017-09-13 12:30:45';
         $period = eval('return \\'.$periodClass.'::start(date: $date, inclusive: false);');
         $this->assertEquals(Carbon::parse($date), $period->getStartDate());
@@ -72,7 +72,7 @@ class AliasTest extends AbstractTestCase
 
     public function testSetEndDate()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::end($date = '2017-09-13 12:30:45', false);
         $this->assertEquals(Carbon::parse($date), $period->getEndDate());
         $this->assertEquals(Carbon::parse($date), $period->end);
@@ -95,7 +95,7 @@ class AliasTest extends AbstractTestCase
      */
     public function testSetEndDateWithNamedParameters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $date = '2017-09-13 12:30:45';
         $period = eval('return \\'.$periodClass.'::end(date: $date, inclusive: false);');
         $this->assertEquals(Carbon::parse($date), $period->getEndDate());
@@ -118,7 +118,7 @@ class AliasTest extends AbstractTestCase
             return true;
         };
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::filter($filter, 'foo');
         $this->assertSame([[$filter, 'foo']], $period->getFilters());
 
@@ -137,7 +137,7 @@ class AliasTest extends AbstractTestCase
 
     public function testSetRecurrences()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::recurrences(5);
         $this->assertSame(5, $period->getRecurrences());
         $this->assertSame(5, $period->recurrences);
@@ -151,7 +151,7 @@ class AliasTest extends AbstractTestCase
 
     public function testManageOptions()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $start = $periodClass::EXCLUDE_START_DATE;
         $end = $periodClass::EXCLUDE_END_DATE;
 
@@ -170,7 +170,7 @@ class AliasTest extends AbstractTestCase
 
     public function testSetDates()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::dates($start = '2014-10-12 15:42:34', $end = '2017-09-13 12:30:45');
         $this->assertEquals(Carbon::parse($start), $period->getStartDate());
         $this->assertEquals(Carbon::parse($end), $period->getEndDate());
@@ -182,7 +182,7 @@ class AliasTest extends AbstractTestCase
 
     public function testManageInterval()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::interval('PT6H');
         $this->assertEquals(CarbonInterval::create('PT6H'), $period->getDateInterval());
         $this->assertEquals(CarbonInterval::create('PT6H'), $period->interval);
@@ -190,14 +190,14 @@ class AliasTest extends AbstractTestCase
 
     public function testInvertInterval()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::invert();
         $this->assertEquals(CarbonInterval::create('P1D')->invert(), $period->getDateInterval());
     }
 
     public function testModifyIntervalPlural()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::weeks(2);
         $this->assertSame('P14D', $period->getDateInterval()->spec());
 
@@ -210,7 +210,7 @@ class AliasTest extends AbstractTestCase
 
     public function testModifyIntervalSingular()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::week();
         $this->assertSame('P7D', $period->getDateInterval()->spec());
 
@@ -223,7 +223,7 @@ class AliasTest extends AbstractTestCase
 
     public function testChainAliases()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         Carbon::setTestNow('2018-05-15');
         $period = $periodClass::days(3)->hours(5)->invert()
             ->sinceNow()->until(Carbon::now()->subDays(10))
@@ -244,13 +244,13 @@ class AliasTest extends AbstractTestCase
             'Method foobar does not exist.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::foobar();
     }
 
     public function testOverrideDefaultInterval()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::hours(5);
         $this->assertSame('PT5H', $period->getDateInterval()->spec());
 
@@ -267,7 +267,7 @@ class AliasTest extends AbstractTestCase
             'Empty interval is not accepted.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::days(0);
     }
 
@@ -276,7 +276,7 @@ class AliasTest extends AbstractTestCase
      */
     public function testNamedParameters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = eval("return \\$periodClass::between(start: '2022-09-13', end: '2022-10-12');");
         $this->assertEquals('2022-09-13', $period->getStartDate()->format('Y-m-d'));
         $this->assertEquals('2022-10-12', $period->getEndDate()->format('Y-m-d'));
diff --git a/tests/CarbonPeriod/CloneTest.php b/tests/CarbonPeriod/CloneTest.php
index c1211ce..f125987 100644
--- a/tests/CarbonPeriod/CloneTest.php
+++ b/tests/CarbonPeriod/CloneTest.php
@@ -19,7 +19,7 @@ class CloneTest extends AbstractTestCase
 {
     public function testClone()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('R4/2012-07-01T00:00:00/P7D');
         $clone = $period->clone();
 
@@ -30,7 +30,7 @@ class CloneTest extends AbstractTestCase
 
     public function testCopy()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('R4/2012-07-01T00:00:00/P7D');
         $clone = $period->copy();
 
diff --git a/tests/CarbonPeriod/ComparisonTest.php b/tests/CarbonPeriod/ComparisonTest.php
index d37f3af..43077cf 100644
--- a/tests/CarbonPeriod/ComparisonTest.php
+++ b/tests/CarbonPeriod/ComparisonTest.php
@@ -26,7 +26,7 @@ class ComparisonTest extends AbstractTestCase
 {
     public function testEqualToTrue()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2010-01-01', '2010-02-01');
 
         $this->assertTrue($period->equalTo($period));
@@ -53,7 +53,7 @@ class ComparisonTest extends AbstractTestCase
 
     public function testEqualToFalse()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2010-01-01', '2010-02-01');
 
         $this->assertFalse($period->equalTo($periodClass::create('2010-01-02', '2010-02-01')));
@@ -65,7 +65,7 @@ class ComparisonTest extends AbstractTestCase
 
     public function testNotEqualToTrue()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2010-01-01', '2010-02-01');
 
         $this->assertTrue($period->notEqualTo($periodClass::create('2010-01-02', '2010-02-01')));
@@ -77,7 +77,7 @@ class ComparisonTest extends AbstractTestCase
 
     public function testNotEqualToFalse()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2010-01-01', '2010-02-01');
 
         $this->assertFalse($period->notEqualTo($period));
@@ -104,7 +104,7 @@ class ComparisonTest extends AbstractTestCase
 
     public function testStartComparisons()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         Carbon::setTestNow('2020-01-01');
         CarbonImmutable::setTestNow('2020-01-01');
 
@@ -130,7 +130,7 @@ class ComparisonTest extends AbstractTestCase
 
     public function testEndComparisons()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         Carbon::setTestNow('2020-02-05');
         CarbonImmutable::setTestNow('2020-02-05');
 
@@ -162,7 +162,7 @@ class ComparisonTest extends AbstractTestCase
 
     public function testContains()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2019-08-01', '2019-08-10');
 
         $this->assertFalse($period->contains('2019-07-31 23:59:59'));
@@ -182,7 +182,7 @@ class ComparisonTest extends AbstractTestCase
 
     public function testConsecutivePeriods()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $july = $periodClass::create('2019-07-29', '2019-07-31');
         $august = $periodClass::create('2019-08-01', '2019-08-12');
 
@@ -251,7 +251,7 @@ class ComparisonTest extends AbstractTestCase
 
     public function testConsecutivePeriodsWithExclusion()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $july = $periodClass::create('2019-07-29', '2019-08-01', $periodClass::EXCLUDE_END_DATE);
         $august = $periodClass::create('2019-07-31', '2019-08-12', $periodClass::EXCLUDE_START_DATE);
 
@@ -267,7 +267,7 @@ class ComparisonTest extends AbstractTestCase
 
     public function testConsecutivePeriodsWithDynamicEnd()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $july = $periodClass::create('2019-07-29', '1 day', 4);
         $august = $periodClass::create('2019-08-02', '2019-08-12');
 
diff --git a/tests/CarbonPeriod/CreateTest.php b/tests/CarbonPeriod/CreateTest.php
index 86b3d0a..7f80812 100644
--- a/tests/CarbonPeriod/CreateTest.php
+++ b/tests/CarbonPeriod/CreateTest.php
@@ -35,7 +35,7 @@ class CreateTest extends AbstractTestCase
      */
     public function testCreateFromIso8601String($arguments, $expected)
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         [$iso, $options] = array_pad($arguments, 2, null);
 
         $period = $periodClass::create($iso, $options);
@@ -72,7 +72,7 @@ class CreateTest extends AbstractTestCase
 
     public function testCreateFromIso8601StringWithUnboundedRecurrences()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('R/2012-07-01T00:00:00/P7D');
 
         $this->assertSame('2012-07-01', $period->getStartDate()->toDateString());
@@ -83,7 +83,7 @@ class CreateTest extends AbstractTestCase
 
     public function testCreateFromIso8601StringWithInfiniteRecurrences()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('RINF/2012-07-01T00:00:00/P7D');
         $this->assertSame('2012-07-01', $period->getStartDate()->toDateString());
         $this->assertSame('P7D', $period->getDateInterval()->spec());
@@ -96,7 +96,7 @@ class CreateTest extends AbstractTestCase
      */
     public function testCreateFromPartialIso8601String($iso, $from, $to)
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create($iso);
 
         $this->assertSame(
@@ -127,7 +127,7 @@ class CreateTest extends AbstractTestCase
             "Invalid ISO 8601 specification: $iso"
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::create($iso);
     }
 
@@ -146,7 +146,7 @@ class CreateTest extends AbstractTestCase
      */
     public function testCreateFromStartDateAndEndDate($arguments, $expected)
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         [$start, $end, $options] = array_pad($arguments, 3, null);
 
         $start = Carbon::parse($start);
@@ -201,7 +201,7 @@ class CreateTest extends AbstractTestCase
      */
     public function testCreateFromStartDateAndIntervalAndEndDate($arguments, $expected)
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         [$start, $interval, $end, $options] = array_pad($arguments, 4, null);
 
         $start = Carbon::parse($start);
@@ -262,7 +262,7 @@ class CreateTest extends AbstractTestCase
      */
     public function testCreateFromStartDateAndIntervalAndRecurrences($arguments, $expected)
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         [$start, $interval, $recurrences, $options] = array_pad($arguments, 4, null);
 
         $start = Carbon::parse($start);
@@ -293,7 +293,7 @@ class CreateTest extends AbstractTestCase
      */
     public function testCreateFromStartDateAndRecurrences($arguments, $expected)
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         [$start, $recurrences, $options] = array_pad($arguments, 4, null);
 
         $start = Carbon::parse($start);
@@ -328,7 +328,7 @@ class CreateTest extends AbstractTestCase
 
     public function testCreateFromBaseClasses()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             new DateTime('2018-04-16'),
             new DateInterval('P1M'),
@@ -354,7 +354,7 @@ class CreateTest extends AbstractTestCase
             'Invalid constructor parameters.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::create(...$arguments);
     }
 
@@ -371,7 +371,7 @@ class CreateTest extends AbstractTestCase
 
     public function testCreateOnDstForwardChange()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             '2018-03-25 1:30 Europe/Oslo',
             'PT30M',
@@ -398,7 +398,7 @@ class CreateTest extends AbstractTestCase
      */
     public function testCreateOnDstBackwardChange()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             '2018-10-28 1:30 Europe/Oslo',
             'PT30M',
@@ -421,7 +421,7 @@ class CreateTest extends AbstractTestCase
 
     public function testInternalVariablesCannotBeIndirectlyModified()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             $start = new DateTime('2018-04-16'),
             $interval = new DateInterval('P1M'),
@@ -453,7 +453,7 @@ class CreateTest extends AbstractTestCase
 
     public function testCreateFromArray()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::createFromArray([
             '2018-03-25', 'P2D', '2018-04-01', $periodClass::EXCLUDE_END_DATE,
         ]);
@@ -466,7 +466,7 @@ class CreateTest extends AbstractTestCase
 
     public function testCreateFromIso()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::createFromIso('R3/2018-03-25/P2D/2018-04-01', $periodClass::EXCLUDE_END_DATE);
 
         $this->assertSame('2018-03-25', $period->getStartDate()->toDateString());
@@ -478,7 +478,7 @@ class CreateTest extends AbstractTestCase
 
     public function testCreateEmpty()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $this->assertEquals(new Carbon(), $period->getStartDate());
@@ -490,7 +490,7 @@ class CreateTest extends AbstractTestCase
 
     public function testCreateFromDateStringsWithTimezones()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             $start = '2018-03-25 10:15:30 Europe/Oslo',
             $end = '2018-03-28 17:25:30 Asia/Kamchatka'
@@ -502,7 +502,7 @@ class CreateTest extends AbstractTestCase
 
     public function testCreateWithIntervalInFromStringFormat()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             '2018-03-25 12:00',
             '2 days 10 hours',
@@ -528,7 +528,7 @@ class CreateTest extends AbstractTestCase
 
     public function testCreateFromRelativeDates()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             $start = 'previous friday',
             $end = '+6 days'
@@ -621,7 +621,7 @@ class CreateTest extends AbstractTestCase
 
     public function testInstance()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $source = new DatePeriod(
             new DateTime('2012-07-01'),
             CarbonInterval::days(2),
@@ -665,7 +665,7 @@ class CreateTest extends AbstractTestCase
      */
     public function testCreateFromCarbonInstancesNamedParameters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $carbonClass = $periodClass === CarbonPeriodImmutable::class
             ? CarbonImmutable::class
             : Carbon::class;
@@ -684,7 +684,7 @@ class CreateTest extends AbstractTestCase
 
     public function testCast()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass === CarbonPeriodImmutable::class
             ? (new class('2012-07-01', CarbonInterval::days(2), '2012-07-07') extends CarbonPeriodImmutable {
                 public function foo()
@@ -722,14 +722,14 @@ class CreateTest extends AbstractTestCase
             'DateTime has not the instance() method needed to cast the date.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::create('2010-08-24', CarbonInterval::weeks(2), '2012-07-19')
             ->cast(DateTime::class);
     }
 
     public function testMake()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::make(new DatePeriod(
             new DateTime('2012-07-01'),
             CarbonInterval::days(2),
@@ -764,7 +764,7 @@ class CreateTest extends AbstractTestCase
             'must be an instance of DatePeriod or Carbon\CarbonPeriod, string given.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::instance('hello');
     }
 
@@ -775,7 +775,7 @@ class CreateTest extends AbstractTestCase
             'must be an instance of DatePeriod or Carbon\CarbonPeriod, instance of Carbon\Carbon given.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::instance(Carbon::now());
     }
 
diff --git a/tests/CarbonPeriod/DynamicIntervalTest.php b/tests/CarbonPeriod/DynamicIntervalTest.php
index bedefbf..746ff1c 100644
--- a/tests/CarbonPeriod/DynamicIntervalTest.php
+++ b/tests/CarbonPeriod/DynamicIntervalTest.php
@@ -20,7 +20,7 @@ class DynamicIntervalTest extends AbstractTestCase
 {
     public function testDynamicIntervalInPeriod()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $weekDayStep = function (Carbon $date, bool $negated = false): Carbon {
             if ($negated) {
                 return $date->previousWeekDay();
diff --git a/tests/CarbonPeriod/FilterTest.php b/tests/CarbonPeriod/FilterTest.php
index c7ab793..be09c8b 100644
--- a/tests/CarbonPeriod/FilterTest.php
+++ b/tests/CarbonPeriod/FilterTest.php
@@ -34,7 +34,7 @@ class FilterTest extends AbstractTestCase
 
     public function testGetAndSetFilters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $this->assertSame([], $period->getFilters());
@@ -46,7 +46,7 @@ class FilterTest extends AbstractTestCase
 
     public function testUpdateInternalStateWhenBuiltInFiltersAreRemoved()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass(
             $start = new DateTime('2018-04-16'),
             $end = new DateTime('2018-07-15')
@@ -66,7 +66,7 @@ class FilterTest extends AbstractTestCase
 
     public function testResetFilters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass(
             $start = new DateTime('2018-04-16'),
             $end = new DateTime('2018-07-15')
@@ -84,7 +84,7 @@ class FilterTest extends AbstractTestCase
 
     public function testAddAndPrependFilters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period->addFilter($filter1 = $this->dummyFilter())
@@ -100,7 +100,7 @@ class FilterTest extends AbstractTestCase
 
     public function testRemoveFilterByInstance()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period->addFilter($filter1 = $this->dummyFilter())
@@ -117,7 +117,7 @@ class FilterTest extends AbstractTestCase
 
     public function testRemoveFilterByName()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period->addFilter($filter1 = $this->dummyFilter())
@@ -137,7 +137,7 @@ class FilterTest extends AbstractTestCase
 
     public function testAcceptOnlyWeekdays()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
 
         Carbon::setWeekendDays([
             Carbon::SATURDAY,
@@ -161,7 +161,7 @@ class FilterTest extends AbstractTestCase
      */
     public function testAcceptOnlySingleYear()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass(
             new DateTime('2017-04-16'),
             new DateInterval('P5M'),
@@ -183,7 +183,7 @@ class FilterTest extends AbstractTestCase
      */
     public function testEndIteration()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass(
             new DateTime('2018-04-16'),
             new DateInterval('P3D'),
@@ -202,7 +202,7 @@ class FilterTest extends AbstractTestCase
 
     public function testRecurrences()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass(
             new DateTime('2018-04-16'),
             new DateTime('2018-07-15')
@@ -232,7 +232,7 @@ class FilterTest extends AbstractTestCase
 
     public function testChangeNumberOfRecurrences()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass(
             new DateTime('2018-04-16'),
             new DateTime('2018-07-15')
@@ -250,7 +250,7 @@ class FilterTest extends AbstractTestCase
 
     public function testCallbackArguments()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass(
             new DateTime('2018-04-16'),
             1
@@ -278,7 +278,7 @@ class FilterTest extends AbstractTestCase
             'Could not find next valid date.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             new Carbon('2000-01-01'),
             new CarbonInterval('PT1S'),
@@ -294,7 +294,7 @@ class FilterTest extends AbstractTestCase
 
     public function testRemoveBuildInFilters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(new DateTime('2018-04-16'), new DateTime('2018-07-15'))->setRecurrences(3);
 
         $period->setEndDate(null);
@@ -305,7 +305,7 @@ class FilterTest extends AbstractTestCase
 
     public function testAcceptEveryOther()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass(
             new DateTime('2018-04-16'),
             new DateTime('2018-04-20')
@@ -327,7 +327,7 @@ class FilterTest extends AbstractTestCase
 
     public function testEndIterationFilter()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass('2018-04-16', 5);
 
         $period->addFilter($periodClass::END_ITERATION);
@@ -337,7 +337,7 @@ class FilterTest extends AbstractTestCase
 
     public function testAcceptOnlyEvenDays()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $this->assertSame(
             $this->standardizeDates(['2012-07-04', '2012-07-10', '2012-07-16']),
@@ -347,7 +347,7 @@ class FilterTest extends AbstractTestCase
 
     public function testAddFilterFromCarbonMethod()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2018-01-01', '2018-06-01');
 
         $period->addFilter('isLastOfMonth');
@@ -360,7 +360,7 @@ class FilterTest extends AbstractTestCase
 
     public function testAddFilterFromCarbonMacro()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2018-01-01', '2018-06-01');
 
         Carbon::macro('isTenDay', function () {
diff --git a/tests/CarbonPeriod/GettersTest.php b/tests/CarbonPeriod/GettersTest.php
index 40ca1ab..f6d31b2 100644
--- a/tests/CarbonPeriod/GettersTest.php
+++ b/tests/CarbonPeriod/GettersTest.php
@@ -27,7 +27,7 @@ class GettersTest extends AbstractTestCase
 {
     public function testGetStartDate()
     {
-        $period = CarbonPeriodFactory::withStartIntervalEnd($this->periodClass);
+        $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass);
 
         $date = $period->getStartDate();
 
@@ -38,7 +38,7 @@ class GettersTest extends AbstractTestCase
 
     public function testGetEndDate()
     {
-        $period = CarbonPeriodFactory::withStartIntervalEnd($this->periodClass);
+        $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass);
 
         $date = $period->getEndDate();
 
@@ -49,7 +49,7 @@ class GettersTest extends AbstractTestCase
 
     public function testGetDateInterval()
     {
-        $period = CarbonPeriodFactory::withStartIntervalEnd($this->periodClass);
+        $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass);
 
         $interval = $period->getDateInterval();
 
@@ -76,7 +76,7 @@ class GettersTest extends AbstractTestCase
 
     public function testModifyStartDate()
     {
-        $period = CarbonPeriodFactory::withStartIntervalEnd($this->periodClass);
+        $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass);
 
         $period->getStartDate()->subDays(3);
 
@@ -85,7 +85,7 @@ class GettersTest extends AbstractTestCase
 
     public function testModifyEndDate()
     {
-        $period = CarbonPeriodFactory::withStartIntervalEnd($this->periodClass);
+        $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass);
 
         $period->getEndDate()->addDays(3);
 
@@ -94,7 +94,7 @@ class GettersTest extends AbstractTestCase
 
     public function testModifyDateInterval()
     {
-        $period = CarbonPeriodFactory::withStartIntervalEnd($this->periodClass);
+        $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass);
 
         $period->getDateInterval()->days(5)->hours(0);
 
diff --git a/tests/CarbonPeriod/IteratorTest.php b/tests/CarbonPeriod/IteratorTest.php
index 88ca1ff..62b9d25 100644
--- a/tests/CarbonPeriod/IteratorTest.php
+++ b/tests/CarbonPeriod/IteratorTest.php
@@ -26,7 +26,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testKeyAndCurrentAreCorrectlyInstantiated()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $this->assertSame(0, $period->key());
         $this->assertInstanceOfCarbon($period->current());
@@ -36,14 +36,14 @@ class IteratorTest extends AbstractTestCase
 
     public function testValidIsCorrectlyInstantiated()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $this->assertTrue($period->valid());
     }
 
     public function testCurrentIsAlwaysCarbonInstance()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         foreach ($period as $key => $current) {
             $this->assertInstanceOfCarbon($current);
@@ -56,7 +56,7 @@ class IteratorTest extends AbstractTestCase
     {
         $keys = [];
 
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         foreach ($period as $key => $current) {
             $this->assertIsInt($keys[] = $key);
@@ -68,7 +68,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testElementsInLoopAreAlwaysValid()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         foreach ($period as $key => $current) {
             $this->assertTrue($period->valid());
@@ -77,7 +77,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testKeyAndCurrentAreCorrectlyIterated()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $period->next();
 
@@ -88,7 +88,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testKeyAndCurrentAreCorrectlyRewound()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $period->next();
         $period->rewind();
@@ -100,7 +100,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testKeyAndCurrentAreNullAfterIteration()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         foreach ($period as $key => $current) {
             //
@@ -116,7 +116,7 @@ class IteratorTest extends AbstractTestCase
      */
     public function testIterateBackwards($arguments, $expected)
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(...$arguments);
 
         $interval = new CarbonInterval('P3D');
@@ -156,7 +156,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testChangingParametersShouldNotCauseInfiniteLoop()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create()
             ->setStartDate($start = '2012-07-01')
             ->setEndDate($end = '2012-07-20')
@@ -192,7 +192,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testChangeEndDateDuringIteration()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $results = [];
 
@@ -309,7 +309,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testValidateOncePerIteration()
     {
-        $period = CarbonPeriodFactory::withCounter($this->periodClass, $counter);
+        $period = CarbonPeriodFactory::withCounter(static::$periodClass, $counter);
 
         $period->key();
         $period->current();
@@ -327,7 +327,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testInvalidateCurrentAfterChangingParameters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2012-10-01');
 
         $this->assertInstanceOfCarbon($period->current());
@@ -339,7 +339,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testTraversePeriodDynamically()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $results = [];
 
@@ -361,7 +361,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testExtendCompletedIteration()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2018-10-10', '2018-10-11');
 
         $results = [];
@@ -388,7 +388,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testRevalidateCurrentAfterChangeOfParameters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create()->setStartDate($start = new Carbon('2018-10-28'));
         $this->assertEquals($start, $period->current());
         $this->assertNotSame($start, $period->current());
@@ -405,7 +405,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testRevalidateCurrentAfterEndOfIteration()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create()->setStartDate($start = new Carbon('2018-10-28'));
         $this->assertEquals($start, $period->current());
         $this->assertNotSame($start, $period->current());
@@ -420,7 +420,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testChangeStartDateBeforeIteration()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(new Carbon('2018-10-05'), 3)
             ->setStartDate(new Carbon('2018-10-13'))
             ->toggleOptions($periodClass::EXCLUDE_START_DATE, true);
@@ -430,7 +430,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testChangeStartDateAfterStartedIteration()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(new Carbon('2018-10-05'), 3);
 
         $current = $period->current();
@@ -443,7 +443,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testInvertDateIntervalDuringIteration()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass('2018-04-11', 5);
 
         $results = [];
@@ -464,7 +464,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testManualIteration()
     {
-        $period = CarbonPeriodFactory::withStackFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withStackFilter(static::$periodClass);
         $period->rewind();
         $str = '';
         while ($period->valid()) {
@@ -480,7 +480,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testSkip()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2018-05-30', '2018-07-13');
         $output = [];
 
@@ -531,7 +531,7 @@ class IteratorTest extends AbstractTestCase
     public function testLocale()
     {
         /** @var CarbonPeriod $period */
-        $period = CarbonPeriodFactory::withStackFilter($this->periodClass)->locale('de');
+        $period = CarbonPeriodFactory::withStackFilter(static::$periodClass)->locale('de');
         $str = '';
 
         foreach ($period as $key => $date) {
@@ -547,7 +547,7 @@ class IteratorTest extends AbstractTestCase
 
     public function testTimezone()
     {
-        $period = CarbonPeriodFactory::withStackFilter($this->periodClass)->shiftTimezone('America/Toronto');
+        $period = CarbonPeriodFactory::withStackFilter(static::$periodClass)->shiftTimezone('America/Toronto');
         $str = null;
 
         foreach ($period as $key => $date) {
diff --git a/tests/CarbonPeriod/MacroTest.php b/tests/CarbonPeriod/MacroTest.php
index 3445346..54dae93 100644
--- a/tests/CarbonPeriod/MacroTest.php
+++ b/tests/CarbonPeriod/MacroTest.php
@@ -43,14 +43,14 @@ class MacroTest extends AbstractTestCase
 
     protected function tearDown(): void
     {
-        $this->setStaticProperty($this->periodClass, 'macros', []);
+        $this->setStaticProperty(static::$periodClass, 'macros', []);
 
         parent::tearDown();
     }
 
     public function testCallMacro()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::macro('onlyWeekdays', function () {
             /** @var CarbonPeriod $period */
             $period = $this;
@@ -78,7 +78,7 @@ class MacroTest extends AbstractTestCase
 
     public function testParameterOtherThanSelfIsNotGivenPeriodInstance()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::macro('foobar', function ($param = 123) {
             return $param;
         });
@@ -91,7 +91,7 @@ class MacroTest extends AbstractTestCase
 
     public function testPassPeriodInstanceAfterOptionalParameters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::macro('formatStartDate', function ($format = 'l, j F Y') {
             /** @var CarbonPeriod $period */
             $period = $this;
@@ -110,7 +110,7 @@ class MacroTest extends AbstractTestCase
 
     public function testMacroIsBindedToDatePeriodInstance()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::macro('myself', function () {
             return $this;
         });
@@ -124,7 +124,7 @@ class MacroTest extends AbstractTestCase
 
     public function testCallMacroStatically()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::macro('countWeekdaysBetween', function ($from, $to) use ($periodClass) {
             return $periodClass::create($from, $to)
                 ->addFilter(function ($date) {
@@ -141,7 +141,7 @@ class MacroTest extends AbstractTestCase
 
     public function testMacroIsBoundToDatePeriodClass()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::macro('newMyself', function () {
             return new static();
         });
@@ -151,7 +151,7 @@ class MacroTest extends AbstractTestCase
 
     public function testRegisterNonClosureMacro()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::macro('lower', 'strtolower');
 
         /** @var mixed $period */
@@ -163,7 +163,7 @@ class MacroTest extends AbstractTestCase
 
     public function testRegisterMixin()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::mixin(new Mixin());
 
         $this->assertNull($periodClass::getFoo());
@@ -178,7 +178,7 @@ class MacroTest extends AbstractTestCase
             'Method nonExistingMacro does not exist.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         /** @var mixed $period */
         $period = $periodClass::create();
 
@@ -191,13 +191,13 @@ class MacroTest extends AbstractTestCase
             'Method nonExistingMacro does not exist.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::nonExistingMacro();
     }
 
     public function testOverrideAlias()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::macro('recurrences', function () {
             return 'foo';
         });
@@ -207,7 +207,7 @@ class MacroTest extends AbstractTestCase
 
     public function testInstantiateViaStaticMacroCall()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::macro('fromTomorrow', function () {
             /** @var CarbonPeriod $period */
             $period = $this;
@@ -225,7 +225,7 @@ class MacroTest extends AbstractTestCase
         require_once __DIR__.'/Fixtures/MixinTrait.php';
         require_once __DIR__.'/Fixtures/MacroableClass.php';
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::mixin(MixinTrait::class);
 
         $period = $periodClass::create('2023-06-10', '2023-06-12');
@@ -236,7 +236,7 @@ class MacroTest extends AbstractTestCase
         $this->assertSame('Every 1 day from 2023-06-10 to 2023-06-13', (string) $copy);
 
         $mutated = $period->oneMoreDay();
-        $immutable = ($this->periodClass === CarbonPeriodImmutable::class);
+        $immutable = (static::$periodClass === CarbonPeriodImmutable::class);
         $expectedEnd = $immutable ? '2023-06-12' : '2023-06-13';
 
         $this->assertSame('Every 1 day from 2023-06-10 to 2023-06-13', (string) $mutated);
@@ -246,13 +246,13 @@ class MacroTest extends AbstractTestCase
         $this->assertSame(
             $immutable,
             ($mutated !== $period),
-            "{$this->periodClass}::oneMoreDay() should return $expectedResult"
+            "{static::$periodClass}::oneMoreDay() should return $expectedResult"
         );
 
         $this->assertNotSame($copy, $period);
 
         $this->assertSame('2023-06-14', $mutated->endNextDay()->format('Y-m-d'));
-        $this->assertSame($this->periodClass === CarbonPeriodImmutable::class
+        $this->assertSame(static::$periodClass === CarbonPeriodImmutable::class
             ? '2023-06-13'
             : '2023-06-14', $period->endNextDay()->format('Y-m-d'));
 
diff --git a/tests/CarbonPeriod/RoundingTest.php b/tests/CarbonPeriod/RoundingTest.php
index 8be40c0..bec60a0 100644
--- a/tests/CarbonPeriod/RoundingTest.php
+++ b/tests/CarbonPeriod/RoundingTest.php
@@ -25,13 +25,13 @@ class RoundingTest extends AbstractTestCase
             'Rounding is only possible with single unit intervals.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::days(2)->round('2 hours 50 minutes');
     }
 
     public function testFloor()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817')->floor();
 
         $this->assertSame('01 00:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F'));
@@ -78,7 +78,7 @@ class RoundingTest extends AbstractTestCase
 
     public function testCeil()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817')->ceil();
 
         $this->assertSame('01 00:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F'));
@@ -125,7 +125,7 @@ class RoundingTest extends AbstractTestCase
 
     public function testRound()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817')->round();
 
         $this->assertSame('01 00:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F'));
@@ -172,7 +172,7 @@ class RoundingTest extends AbstractTestCase
 
     public function testRoundCalculatedEnd()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2019-02-01 12:52:23.123456', '3 hours')->setRecurrences(3);
 
         $this->assertSame('2019-02-01 18:00:00.000000', $period->calculateEnd('round')->format('Y-m-d H:i:s.u'));
diff --git a/tests/CarbonPeriod/SettersTest.php b/tests/CarbonPeriod/SettersTest.php
index 3b8475b..43c8f4d 100644
--- a/tests/CarbonPeriod/SettersTest.php
+++ b/tests/CarbonPeriod/SettersTest.php
@@ -26,7 +26,7 @@ class SettersTest extends AbstractTestCase
 {
     public function testSetStartDate()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->setStartDate('2018-03-25');
@@ -36,7 +36,7 @@ class SettersTest extends AbstractTestCase
 
     public function testSetEndDate()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->setEndDate('2018-04-25');
@@ -46,7 +46,7 @@ class SettersTest extends AbstractTestCase
 
     public function testSetDateInterval()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->setDateInterval('P3D');
@@ -56,7 +56,7 @@ class SettersTest extends AbstractTestCase
 
     public function testSetDateIntervalFromStringFormat()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->setDateInterval('1w 3d 4h 32m 23s');
@@ -66,7 +66,7 @@ class SettersTest extends AbstractTestCase
 
     public function testSetRecurrences()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->setRecurrences(5);
@@ -76,7 +76,7 @@ class SettersTest extends AbstractTestCase
 
     public function testSetDates()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->setDates('2019-04-12', '2019-04-19');
@@ -87,7 +87,7 @@ class SettersTest extends AbstractTestCase
 
     public function testSetOptions()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->setOptions($options = $periodClass::EXCLUDE_START_DATE | $periodClass::EXCLUDE_END_DATE);
@@ -97,7 +97,7 @@ class SettersTest extends AbstractTestCase
 
     public function testSetDateClass()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass('2001-01-01', '2001-01-02');
 
         $period = $period->setDateClass(CarbonImmutable::class);
@@ -128,7 +128,7 @@ class SettersTest extends AbstractTestCase
             'Given class does not implement Carbon\CarbonInterface: Carbon\CarbonInterval'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass('2001-01-01', '2001-01-02');
 
         $period->setDateClass(CarbonInterval::class);
@@ -140,7 +140,7 @@ class SettersTest extends AbstractTestCase
             'Invalid interval.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::create()->setDateInterval(new DateTime());
     }
 
@@ -150,7 +150,7 @@ class SettersTest extends AbstractTestCase
             'Empty interval is not accepted.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::create()->setDateInterval(new DateInterval('P0D'));
     }
 
@@ -160,7 +160,7 @@ class SettersTest extends AbstractTestCase
             'Invalid number of recurrences.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::create()->setRecurrences('foo');
     }
 
@@ -170,7 +170,7 @@ class SettersTest extends AbstractTestCase
             'Invalid number of recurrences.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::create()->setRecurrences(-4);
     }
 
@@ -180,7 +180,7 @@ class SettersTest extends AbstractTestCase
             'Invalid options.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::create()->setOptions('1');
     }
 
@@ -190,7 +190,7 @@ class SettersTest extends AbstractTestCase
             'Invalid constructor parameters.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::create([]);
     }
 
@@ -200,7 +200,7 @@ class SettersTest extends AbstractTestCase
             'Invalid start date.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::create()->setStartDate(new DateInterval('P1D'));
     }
 
@@ -210,13 +210,13 @@ class SettersTest extends AbstractTestCase
             'Invalid end date.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $periodClass::create()->setEndDate(new DateInterval('P1D'));
     }
 
     public function testToggleOptions()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $start = $periodClass::EXCLUDE_START_DATE;
         $end = $periodClass::EXCLUDE_END_DATE;
 
@@ -237,7 +237,7 @@ class SettersTest extends AbstractTestCase
 
     public function testToggleOptionsOnAndOff()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $start = $periodClass::EXCLUDE_START_DATE;
         $end = $periodClass::EXCLUDE_END_DATE;
 
@@ -265,7 +265,7 @@ class SettersTest extends AbstractTestCase
 
     public function testSetStartDateInclusiveOrExclusive()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->setStartDate('2018-03-25');
@@ -280,7 +280,7 @@ class SettersTest extends AbstractTestCase
 
     public function testSetEndDateInclusiveOrExclusive()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->setEndDate('2018-04-25');
@@ -295,7 +295,7 @@ class SettersTest extends AbstractTestCase
 
     public function testInvertDateInterval()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->invertDateInterval();
@@ -320,7 +320,7 @@ class SettersTest extends AbstractTestCase
 
     public function testExcludeStartDate()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->excludeStartDate();
@@ -335,7 +335,7 @@ class SettersTest extends AbstractTestCase
 
     public function testExcludeEndDate()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->excludeEndDate();
@@ -350,7 +350,7 @@ class SettersTest extends AbstractTestCase
 
     public function testSetRelativeDates()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
 
         $period = $period->setDates('first monday of may 2018', 'last day of may 2018 noon');
@@ -361,7 +361,7 @@ class SettersTest extends AbstractTestCase
 
     public function testFluentSetters()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         Carbon::setTestNowAndTimezone(Carbon::now('UTC'));
 
         $period = CarbonInterval::days(3)->toPeriod()->since('2018-04-21')->until('2018-04-27');
@@ -455,7 +455,7 @@ class SettersTest extends AbstractTestCase
 
     public function testSetTimezone(): void
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             '2018-03-25 00:00 America/Toronto',
             'PT1H',
@@ -478,7 +478,7 @@ class SettersTest extends AbstractTestCase
 
     public function testShiftTimezone(): void
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             '2018-03-25 00:00 America/Toronto',
             'PT1H',
diff --git a/tests/CarbonPeriod/StrictModeTest.php b/tests/CarbonPeriod/StrictModeTest.php
index cc07b0e..1277f79 100644
--- a/tests/CarbonPeriod/StrictModeTest.php
+++ b/tests/CarbonPeriod/StrictModeTest.php
@@ -25,7 +25,7 @@ class StrictModeTest extends AbstractTestCase
             'Method foobar does not exist.'
         ));
 
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         /** @var mixed $period */
         $period = $periodClass::create();
         $period->foobar();
@@ -34,7 +34,7 @@ class StrictModeTest extends AbstractTestCase
     public function testCallWithoutStrictMode()
     {
         Carbon::useStrictMode(false);
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         /** @var mixed $period */
         $period = $periodClass::create();
         $this->assertSame($period, $period->foobar());
diff --git a/tests/CarbonPeriod/ToArrayTest.php b/tests/CarbonPeriod/ToArrayTest.php
index c750ad8..1f69a9f 100644
--- a/tests/CarbonPeriod/ToArrayTest.php
+++ b/tests/CarbonPeriod/ToArrayTest.php
@@ -26,7 +26,7 @@ class ToArrayTest extends AbstractTestCase
 {
     public function testToArrayIsNotEmptyArray()
     {
-        $result = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass)->toArray();
+        $result = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass)->toArray();
 
         $this->assertIsArray($result);
         $this->assertNotEmpty($result);
@@ -34,14 +34,14 @@ class ToArrayTest extends AbstractTestCase
 
     public function testToArrayHasCorrectCount()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $this->assertCount(3, $period->toArray());
     }
 
     public function testToArrayValuesAreCarbonInstances()
     {
-        $result = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass)->toArray();
+        $result = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass)->toArray();
 
         foreach ($result as $key => $current) {
             $this->assertInstanceOfCarbon($current);
@@ -50,14 +50,14 @@ class ToArrayTest extends AbstractTestCase
 
     public function testToArrayKeysAreSequential()
     {
-        $result = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass)->toArray();
+        $result = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass)->toArray();
 
         $this->assertSame([0, 1, 2], array_keys($result));
     }
 
     public function testToArrayHasCorrectValues()
     {
-        $result = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass)->toArray();
+        $result = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass)->toArray();
 
         $this->assertSame(
             $this->standardizeDates(['2012-07-04', '2012-07-10', '2012-07-16']),
@@ -67,14 +67,14 @@ class ToArrayTest extends AbstractTestCase
 
     public function testJsonSerialize()
     {
-        $result = json_encode(CarbonPeriodFactory::withEvenDaysFilter($this->periodClass));
+        $result = json_encode(CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass));
 
         $this->assertSame('["2012-07-04T04:00:00.000000Z","2012-07-10T04:00:00.000000Z","2012-07-16T04:00:00.000000Z"]', $result);
     }
 
     public function testCountEmptyPeriod()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $assertThrow = function (CarbonPeriod $period) {
             $message = null;
 
@@ -139,35 +139,35 @@ class ToArrayTest extends AbstractTestCase
 
     public function testCountByMethod()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $this->assertSame(3, $period->count());
     }
 
     public function testCountByFunction()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $this->assertCount(3, $period);
     }
 
     public function testFirst()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $this->assertEquals(new Carbon('2012-07-04'), $period->first());
     }
 
     public function testLast()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $this->assertEquals(new Carbon('2012-07-16'), $period->last());
     }
 
     public function testToArrayOfEmptyPeriod()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $result = $periodClass::create(0)->toArray();
 
         $this->assertIsArray($result);
@@ -176,7 +176,7 @@ class ToArrayTest extends AbstractTestCase
 
     public function testCountOfEmptyPeriod()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(0);
 
         $this->assertSame(0, $period->count());
@@ -184,7 +184,7 @@ class ToArrayTest extends AbstractTestCase
 
     public function testFirstOfEmptyPeriod()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(0);
 
         $this->assertNull($period->first());
@@ -201,7 +201,7 @@ class ToArrayTest extends AbstractTestCase
 
     public function testLastOfEmptyPeriod()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(0);
 
         $this->assertNull($period->last());
@@ -209,7 +209,7 @@ class ToArrayTest extends AbstractTestCase
 
     public function testRestoreIterationStateAfterCallingToArray()
     {
-        $period = CarbonPeriodFactory::withEvenDaysFilter($this->periodClass);
+        $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass);
 
         $key = $period->key();
         $current = $period->current();
@@ -235,7 +235,7 @@ class ToArrayTest extends AbstractTestCase
 
     public function testToArrayResultsAreInTheExpectedTimezone()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2018-05-13 12:00 Asia/Kabul', 'PT1H', 3);
 
         $expected = [
@@ -249,7 +249,7 @@ class ToArrayTest extends AbstractTestCase
 
     public function testDebugInfo()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2018-05-13 12:00 Asia/Kabul', 'PT1H', 3);
 
         $expected = [
diff --git a/tests/CarbonPeriod/ToDatePeriodTest.php b/tests/CarbonPeriod/ToDatePeriodTest.php
index 81443c7..9856aee 100644
--- a/tests/CarbonPeriod/ToDatePeriodTest.php
+++ b/tests/CarbonPeriod/ToDatePeriodTest.php
@@ -27,7 +27,7 @@ class ToDatePeriodTest extends AbstractTestCase
 {
     public function testToArrayIsNotEmptyArray()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2021-01-05', '2021-02-15');
         $result = $period->toDatePeriod();
 
@@ -69,7 +69,7 @@ class ToDatePeriodTest extends AbstractTestCase
     public function testWithIntervalLocalized()
     {
         CarbonInterval::setLocale('fr');
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create('2021-01-05', 3);
         $result = $period->floor()->toDatePeriod();
 
@@ -86,7 +86,7 @@ class ToDatePeriodTest extends AbstractTestCase
 
     public function testWithModifiedEnglish()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $translator = Translator::get('en');
         $translator->setTranslations([
             'day' => ':count boring day|:count boring days',
@@ -107,7 +107,7 @@ class ToDatePeriodTest extends AbstractTestCase
 
     public function testRawDate()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = new $periodClass();
         $method = new ReflectionMethod($periodClass, 'rawDate');
         $method->setAccessible(true);
diff --git a/tests/CarbonPeriod/ToStringTest.php b/tests/CarbonPeriod/ToStringTest.php
index 196f1ea..178efca 100644
--- a/tests/CarbonPeriod/ToStringTest.php
+++ b/tests/CarbonPeriod/ToStringTest.php
@@ -33,9 +33,9 @@ class ToStringTest extends AbstractTestCase
         );
     }
 
-    public function dataForToString(): Generator
+    public static function dataForToString(): Generator
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         Carbon::setTestNowAndTimezone(new Carbon('2015-09-01', 'America/Toronto'));
 
         yield [
@@ -79,7 +79,7 @@ class ToStringTest extends AbstractTestCase
 
     public function testMagicToString()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             Carbon::parse('2015-09-30 12:50'),
             CarbonInterval::days(3)->hours(5),
@@ -103,9 +103,9 @@ class ToStringTest extends AbstractTestCase
         );
     }
 
-    public function dataForToIso8601String(): Generator
+    public static function dataForToIso8601String(): Generator
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         Carbon::setTestNowAndTimezone(new Carbon('2015-09-01', 'America/Toronto'));
 
         yield [
@@ -142,7 +142,7 @@ class ToStringTest extends AbstractTestCase
 
     public function testSpec()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $period = $periodClass::create(
             Carbon::parse('2015-09-30'),
             CarbonInterval::days(3)->hours(5),
@@ -157,7 +157,7 @@ class ToStringTest extends AbstractTestCase
 
     public function testStartOfWeekForPeriod()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $sunday = CarbonImmutable::parse('2019-12-01');
 
         $period = $periodClass::create($sunday->startOfWeek(), '1 week', $sunday->endOfWeek())->toArray();
@@ -177,7 +177,7 @@ class ToStringTest extends AbstractTestCase
 
     public function testToStringCustomization()
     {
-        $periodClass = $this->periodClass;
+        $periodClass = static::$periodClass;
         $sunday = CarbonImmutable::parse('2019-12-01');
 
         $period = $periodClass::create($sunday->startOfWeek(), '1 week', $sunday->endOfWeek());
diff --git a/tests/CarbonPeriodImmutable/AliasTest.php b/tests/CarbonPeriodImmutable/AliasTest.php
index 94af475..50dbcbb 100644
--- a/tests/CarbonPeriodImmutable/AliasTest.php
+++ b/tests/CarbonPeriodImmutable/AliasTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class AliasTest extends \Tests\CarbonPeriod\AliasTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/CloneTest.php b/tests/CarbonPeriodImmutable/CloneTest.php
index 71a9b15..7451449 100644
--- a/tests/CarbonPeriodImmutable/CloneTest.php
+++ b/tests/CarbonPeriodImmutable/CloneTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class CloneTest extends \Tests\CarbonPeriod\CloneTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/ComparisonTest.php b/tests/CarbonPeriodImmutable/ComparisonTest.php
index 94760e4..26633e4 100644
--- a/tests/CarbonPeriodImmutable/ComparisonTest.php
+++ b/tests/CarbonPeriodImmutable/ComparisonTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class ComparisonTest extends \Tests\CarbonPeriod\ComparisonTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/CreateTest.php b/tests/CarbonPeriodImmutable/CreateTest.php
index bea3de5..4ceac28 100644
--- a/tests/CarbonPeriodImmutable/CreateTest.php
+++ b/tests/CarbonPeriodImmutable/CreateTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class CreateTest extends \Tests\CarbonPeriod\CreateTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/DynamicIntervalTest.php b/tests/CarbonPeriodImmutable/DynamicIntervalTest.php
index 8f5ecb5..e0a61a6 100644
--- a/tests/CarbonPeriodImmutable/DynamicIntervalTest.php
+++ b/tests/CarbonPeriodImmutable/DynamicIntervalTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class DynamicIntervalTest extends \Tests\CarbonPeriod\DynamicIntervalTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/FilterTest.php b/tests/CarbonPeriodImmutable/FilterTest.php
index e7443e1..84537b8 100644
--- a/tests/CarbonPeriodImmutable/FilterTest.php
+++ b/tests/CarbonPeriodImmutable/FilterTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class FilterTest extends \Tests\CarbonPeriod\FilterTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/GettersTest.php b/tests/CarbonPeriodImmutable/GettersTest.php
index 4fbaccf..5eb2644 100644
--- a/tests/CarbonPeriodImmutable/GettersTest.php
+++ b/tests/CarbonPeriodImmutable/GettersTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class GettersTest extends \Tests\CarbonPeriod\GettersTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/IterationMethodsTest.php b/tests/CarbonPeriodImmutable/IterationMethodsTest.php
index ee02c95..d4df96f 100644
--- a/tests/CarbonPeriodImmutable/IterationMethodsTest.php
+++ b/tests/CarbonPeriodImmutable/IterationMethodsTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class IterationMethodsTest extends \Tests\CarbonPeriod\IterationMethodsTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/IteratorTest.php b/tests/CarbonPeriodImmutable/IteratorTest.php
index ebad664..2794a98 100644
--- a/tests/CarbonPeriodImmutable/IteratorTest.php
+++ b/tests/CarbonPeriodImmutable/IteratorTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class IteratorTest extends \Tests\CarbonPeriod\IteratorTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/MacroTest.php b/tests/CarbonPeriodImmutable/MacroTest.php
index cecb0f6..abb7e44 100644
--- a/tests/CarbonPeriodImmutable/MacroTest.php
+++ b/tests/CarbonPeriodImmutable/MacroTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class MacroTest extends \Tests\CarbonPeriod\MacroTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/RoundingTest.php b/tests/CarbonPeriodImmutable/RoundingTest.php
index fd97087..eb45f8b 100644
--- a/tests/CarbonPeriodImmutable/RoundingTest.php
+++ b/tests/CarbonPeriodImmutable/RoundingTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class RoundingTest extends \Tests\CarbonPeriod\RoundingTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/SettersTest.php b/tests/CarbonPeriodImmutable/SettersTest.php
index a325a9a..9643775 100644
--- a/tests/CarbonPeriodImmutable/SettersTest.php
+++ b/tests/CarbonPeriodImmutable/SettersTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class SettersTest extends \Tests\CarbonPeriod\SettersTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/StrictModeTest.php b/tests/CarbonPeriodImmutable/StrictModeTest.php
index 29a956a..2dec6e6 100644
--- a/tests/CarbonPeriodImmutable/StrictModeTest.php
+++ b/tests/CarbonPeriodImmutable/StrictModeTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class StrictModeTest extends \Tests\CarbonPeriod\StrictModeTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/ToArrayTest.php b/tests/CarbonPeriodImmutable/ToArrayTest.php
index 219d263..88d00db 100644
--- a/tests/CarbonPeriodImmutable/ToArrayTest.php
+++ b/tests/CarbonPeriodImmutable/ToArrayTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class ToArrayTest extends \Tests\CarbonPeriod\ToArrayTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/ToDatePeriodTest.php b/tests/CarbonPeriodImmutable/ToDatePeriodTest.php
index 104dd1b..fdbcb62 100644
--- a/tests/CarbonPeriodImmutable/ToDatePeriodTest.php
+++ b/tests/CarbonPeriodImmutable/ToDatePeriodTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class ToDatePeriodTest extends \Tests\CarbonPeriod\ToDatePeriodTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
diff --git a/tests/CarbonPeriodImmutable/ToStringTest.php b/tests/CarbonPeriodImmutable/ToStringTest.php
index ed73a9c..d83350f 100644
--- a/tests/CarbonPeriodImmutable/ToStringTest.php
+++ b/tests/CarbonPeriodImmutable/ToStringTest.php
@@ -17,5 +17,5 @@ use Carbon\CarbonPeriodImmutable;
 
 class ToStringTest extends \Tests\CarbonPeriod\ToStringTest
 {
-    protected $periodClass = CarbonPeriodImmutable::class;
+    protected static $periodClass = CarbonPeriodImmutable::class;
 }
