From 770676a6333ec40dc0071a31668ce75a7743e3d5 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Thu, 14 Aug 2025 18:50:41 +0200 Subject: [PATCH] Remove unnecessary checks for PHP <8.1 (in tests) --- .../tests/Integration/LiveComponentHydratorTest.php | 12 ++++++------ .../tests/Unit/ComponentAttributesTest.php | 10 ---------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php b/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php index 442adacc7a7..1b145768644 100644 --- a/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php +++ b/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php @@ -822,7 +822,7 @@ public function onEntireEntityUpdated($oldValue) self::assertNull($object->string); }) ; - }, 80100]; + }]; yield 'Enum: (de)hydrates correctly' => [function () { return HydrationTest::create(new class { @@ -841,7 +841,7 @@ public function onEntireEntityUpdated($oldValue) self::assertSame('active', $object->string->value); }) ; - }, 80100]; + }]; yield 'Enum: writable enums can be changed' => [function () { return HydrationTest::create(new class { @@ -854,7 +854,7 @@ public function onEntireEntityUpdated($oldValue) self::assertSame(1, $object->int->value); }) ; - }, 80100]; + }]; yield 'Enum: null-like enum values are handled correctly' => [function () { return HydrationTest::create(new class { @@ -884,7 +884,7 @@ public function onEntireEntityUpdated($oldValue) self::assertSame(EmptyStringEnum::EMPTY, $object->emptyString); }) ; - }, 80100]; + }]; yield 'Enum: nullable enum with invalid value sets to null' => [function () { return HydrationTest::create(new class { @@ -898,7 +898,7 @@ public function onEntireEntityUpdated($oldValue) self::assertNull($object->int); }) ; - }, 80100]; + }]; yield 'Object: (de)hydrates DTO correctly' => [function () { return HydrationTest::create(new class { @@ -1612,7 +1612,7 @@ public static function provideInvalidHydrationTests(): iterable // non-nullable change is rejected (1=LOW) self::assertSame(1, $object->nonNullableInt->value); }); - }, 80100]; + }]; yield 'writable_path_with_type_problem_ignored' => [function () { return HydrationTest::create(new class { diff --git a/src/TwigComponent/tests/Unit/ComponentAttributesTest.php b/src/TwigComponent/tests/Unit/ComponentAttributesTest.php index 1009da8e558..04764e42c92 100644 --- a/src/TwigComponent/tests/Unit/ComponentAttributesTest.php +++ b/src/TwigComponent/tests/Unit/ComponentAttributesTest.php @@ -139,11 +139,6 @@ public function testCanAddStimulusControllerIfNoneAlreadyPresent() public function testCanAddStimulusControllerViaStimulusAttributes() { - // if PHP less than 8.1, skip - if (version_compare(\PHP_VERSION, '8.1.0', '<')) { - $this->markTestSkipped('PHP 8.1+ required'); - } - $attributes = new ComponentAttributes([ 'class' => 'foo', 'data-controller' => 'live', @@ -167,11 +162,6 @@ public function testCanAddStimulusControllerViaStimulusAttributes() public function testCanAddStimulusActionViaStimulusAttributes() { - // if PHP less than 8.1, skip - if (version_compare(\PHP_VERSION, '8.1.0', '<')) { - $this->markTestSkipped('PHP 8.1+ required'); - } - $attributes = new ComponentAttributes([ 'class' => 'foo', 'data-action' => 'live#foo',