From b519837870491c3237192ed2f1aac1952a522e3b Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Wed, 4 Nov 2026 15:19:32 -0600 Subject: [PATCH 1/2] Keep restored exception JSON free of PHP 8.5 deprecations --- src/V2/Support/FailureFactory.php | 1 - tests/Unit/V2/FailureFactoryRestoreTest.php | 37 +++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/V2/Support/FailureFactory.php b/src/V2/Support/FailureFactory.php index ce2b0b293..4144bc4f1 100644 --- a/src/V2/Support/FailureFactory.php +++ b/src/V2/Support/FailureFactory.php @@ -826,7 +826,6 @@ private static function setThrowableProperty( mixed $value, ): void { $reflectionProperty = new ReflectionProperty($class, $property); - $reflectionProperty->setAccessible(true); $reflectionProperty->setValue($throwable, $value); } diff --git a/tests/Unit/V2/FailureFactoryRestoreTest.php b/tests/Unit/V2/FailureFactoryRestoreTest.php index 7492fe384..e2bf691fb 100644 --- a/tests/Unit/V2/FailureFactoryRestoreTest.php +++ b/tests/Unit/V2/FailureFactoryRestoreTest.php @@ -9,6 +9,7 @@ use Exception; use ReflectionProperty; use RuntimeException; +use Symfony\Component\Process\Process; use Tests\Fixtures\V2\TestAbstractReplayedException; use Tests\NonDatabaseTestCase; use TypeError; @@ -24,6 +25,42 @@ final class FailureFactoryRestoreTest extends NonDatabaseTestCase { + public function testRestorationKeepsCliJsonCleanWithAllErrorsDisplayed(): void + { + $script = <<<'PHP' +require $argv[1]; +$result = []; +foreach ([RuntimeException::class, Error::class] as $class) { + $failure = Workflow\V2\Support\FailureFactory::restore([ + 'class' => $class, + 'message' => 'example', + 'code' => 17, + 'file' => 'example.php', + 'line' => 1, + 'trace' => [], + 'properties' => [], + ]); + $result[$class] = [$failure::class, $failure->getMessage(), $failure->getCode(), $failure->getFile(), $failure->getLine(), $failure->getTrace()]; +} +echo json_encode($result, JSON_THROW_ON_ERROR); +PHP; + $process = new Process([ + PHP_BINARY, + '-d', 'error_reporting=-1', + '-d', 'display_errors=1', + '-d', 'log_errors=0', + '-r', $script, + dirname(__DIR__, 3) . '/vendor/autoload.php', + ]); + $process->mustRun(); + + $this->assertSame('', $process->getErrorOutput()); + $this->assertSame([ + RuntimeException::class => [RuntimeException::class, 'example', 17, 'example.php', 1, []], + Error::class => [Error::class, 'example', 17, 'example.php', 1, []], + ], json_decode($process->getOutput(), true, flags: JSON_THROW_ON_ERROR)); + } + public function testRestoresRecordedActivityTimeoutWithoutApplicationMapping(): void { $payload = [ From 34f9d045803dc2f4f51f1dca70113039c33950a7 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Thu, 5 Nov 2026 20:35:11 +0000 Subject: [PATCH 2/2] Select the isolated throwable restoration regression in PR unit CI --- .github/pr-test-selection.json | 1 + .../Unit/V2/FailureFactoryCliRestoreTest.php | 49 +++++++++++++++++++ tests/Unit/V2/FailureFactoryRestoreTest.php | 37 -------------- 3 files changed, 50 insertions(+), 37 deletions(-) create mode 100644 tests/Unit/V2/FailureFactoryCliRestoreTest.php diff --git a/.github/pr-test-selection.json b/.github/pr-test-selection.json index c28c0fe15..20e5b8daa 100644 --- a/.github/pr-test-selection.json +++ b/.github/pr-test-selection.json @@ -14,6 +14,7 @@ "tests/Unit/V2/EmbeddedHttpSnapshotTest.php", "tests/Unit/V2/ExecutionTracingTest.php", "tests/Unit/V2/ExternalPayloadStorageTest.php", + "tests/Unit/V2/FailureFactoryCliRestoreTest.php", "tests/Unit/V2/LaravelDependencySecurityPolicyTest.php", "tests/Unit/V2/PlatformProtocolSpecsTest.php", "tests/Unit/V2/ReadmeBranchDestinationsTest.php", diff --git a/tests/Unit/V2/FailureFactoryCliRestoreTest.php b/tests/Unit/V2/FailureFactoryCliRestoreTest.php new file mode 100644 index 000000000..fd5e0071f --- /dev/null +++ b/tests/Unit/V2/FailureFactoryCliRestoreTest.php @@ -0,0 +1,49 @@ + $class, + 'message' => 'example', + 'code' => 17, + 'file' => 'example.php', + 'line' => 1, + 'trace' => [], + 'properties' => [], + ]); + $result[$class] = [$failure::class, $failure->getMessage(), $failure->getCode(), $failure->getFile(), $failure->getLine(), $failure->getTrace()]; +} +echo json_encode($result, JSON_THROW_ON_ERROR); +PHP; + $process = new Process([ + PHP_BINARY, + '-d', 'error_reporting=-1', + '-d', 'display_errors=1', + '-d', 'log_errors=0', + '-r', $script, + dirname(__DIR__, 3) . '/vendor/autoload.php', + ]); + $process->mustRun(); + + $this->assertSame('', $process->getErrorOutput()); + $this->assertSame([ + RuntimeException::class => [RuntimeException::class, 'example', 17, 'example.php', 1, []], + Error::class => [Error::class, 'example', 17, 'example.php', 1, []], + ], json_decode($process->getOutput(), true, flags: JSON_THROW_ON_ERROR)); + } +} diff --git a/tests/Unit/V2/FailureFactoryRestoreTest.php b/tests/Unit/V2/FailureFactoryRestoreTest.php index e2bf691fb..7492fe384 100644 --- a/tests/Unit/V2/FailureFactoryRestoreTest.php +++ b/tests/Unit/V2/FailureFactoryRestoreTest.php @@ -9,7 +9,6 @@ use Exception; use ReflectionProperty; use RuntimeException; -use Symfony\Component\Process\Process; use Tests\Fixtures\V2\TestAbstractReplayedException; use Tests\NonDatabaseTestCase; use TypeError; @@ -25,42 +24,6 @@ final class FailureFactoryRestoreTest extends NonDatabaseTestCase { - public function testRestorationKeepsCliJsonCleanWithAllErrorsDisplayed(): void - { - $script = <<<'PHP' -require $argv[1]; -$result = []; -foreach ([RuntimeException::class, Error::class] as $class) { - $failure = Workflow\V2\Support\FailureFactory::restore([ - 'class' => $class, - 'message' => 'example', - 'code' => 17, - 'file' => 'example.php', - 'line' => 1, - 'trace' => [], - 'properties' => [], - ]); - $result[$class] = [$failure::class, $failure->getMessage(), $failure->getCode(), $failure->getFile(), $failure->getLine(), $failure->getTrace()]; -} -echo json_encode($result, JSON_THROW_ON_ERROR); -PHP; - $process = new Process([ - PHP_BINARY, - '-d', 'error_reporting=-1', - '-d', 'display_errors=1', - '-d', 'log_errors=0', - '-r', $script, - dirname(__DIR__, 3) . '/vendor/autoload.php', - ]); - $process->mustRun(); - - $this->assertSame('', $process->getErrorOutput()); - $this->assertSame([ - RuntimeException::class => [RuntimeException::class, 'example', 17, 'example.php', 1, []], - Error::class => [Error::class, 'example', 17, 'example.php', 1, []], - ], json_decode($process->getOutput(), true, flags: JSON_THROW_ON_ERROR)); - } - public function testRestoresRecordedActivityTimeoutWithoutApplicationMapping(): void { $payload = [