From 83ccf746510d308c47ea9d6d9eb4bfee0fd9fe65 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Mon, 24 Aug 2026 16:05:13 +0200 Subject: [PATCH] test(type): isolate intersection test toggle state Construct legacy ConstantArrayType fixtures with bleeding edge disabled so reused ParaTest workers cannot change the expected acceptance results. --- tests/PHPStan/Type/IntersectionTypeTest.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/PHPStan/Type/IntersectionTypeTest.php b/tests/PHPStan/Type/IntersectionTypeTest.php index 28d356bbef2..e21e9f4df57 100644 --- a/tests/PHPStan/Type/IntersectionTypeTest.php +++ b/tests/PHPStan/Type/IntersectionTypeTest.php @@ -8,6 +8,7 @@ use Iterator; use ObjectTypeEnums\FooEnum; use PHPStan\Analyser\OutOfClassScope; +use PHPStan\DependencyInjection\BleedingEdgeToggle; use PHPStan\Testing\PHPStanTestCase; use PHPStan\TrinaryLogic; use PHPStan\Type\Accessory\AccessoryArrayListType; @@ -142,20 +143,20 @@ public static function dataIsAcceptedBy(): Iterator // array&callable isAcceptedBy constantArray{stdClass, string} - maybe yield [ new IntersectionType([new ArrayType(new MixedType(), new MixedType()), new CallableType()]), - new ConstantArrayType( + BleedingEdgeToggle::withBleedingEdge(false, static fn (): ConstantArrayType => new ConstantArrayType( [new ConstantIntegerType(0), new ConstantIntegerType(1)], [new UnionType([new ObjectType('stdClass'), new StringType()]), new StringType()], - ), + )), TrinaryLogic::createMaybe(), ]; // array&callable isAcceptedBy constantArray{string, string} - maybe yield [ new IntersectionType([new ArrayType(new MixedType(), new MixedType()), new CallableType()]), - new ConstantArrayType( + BleedingEdgeToggle::withBleedingEdge(false, static fn (): ConstantArrayType => new ConstantArrayType( [new ConstantIntegerType(0), new ConstantIntegerType(1)], [new StringType(), new StringType()], - ), + )), TrinaryLogic::createMaybe(), ]; @@ -199,10 +200,10 @@ public static function dataIsAcceptedBy(): Iterator new NonEmptyArrayType(), new HasOffsetValueType(new ConstantIntegerType(0), new IntegerType()), ]), - new ConstantArrayType( + BleedingEdgeToggle::withBleedingEdge(false, static fn (): ConstantArrayType => new ConstantArrayType( [new ConstantIntegerType(0), new ConstantIntegerType(1)], [new IntegerType(), new IntegerType()], - ), + )), TrinaryLogic::createMaybe(), ]; @@ -213,10 +214,10 @@ public static function dataIsAcceptedBy(): Iterator new NonEmptyArrayType(), new HasOffsetValueType(new ConstantIntegerType(0), new IntegerType()), ]), - new ConstantArrayType( + BleedingEdgeToggle::withBleedingEdge(false, static fn (): ConstantArrayType => new ConstantArrayType( [new ConstantIntegerType(0), new ConstantIntegerType(1)], [new StringType(), new StringType()], - ), + )), TrinaryLogic::createNo(), ];