diff --git a/tests/Issues/ScopeNotAvailable/FixtureMatchToSwitchReflection/fixture.php.inc b/tests/Issues/ScopeNotAvailable/FixtureMatchToSwitchReflection/fixture.php.inc new file mode 100644 index 00000000..46621dc2 --- /dev/null +++ b/tests/Issues/ScopeNotAvailable/FixtureMatchToSwitchReflection/fixture.php.inc @@ -0,0 +1,46 @@ +setValue($e, $message); + + throw $e; + } + } +} + +?> +----- +setAccessible(true); + } + $r->setValue($e, $message); + + throw $e; + } + } +} + +?> diff --git a/tests/Issues/ScopeNotAvailable/MatchToSwitchReflectionTest.php b/tests/Issues/ScopeNotAvailable/MatchToSwitchReflectionTest.php new file mode 100644 index 00000000..7c26f16d --- /dev/null +++ b/tests/Issues/ScopeNotAvailable/MatchToSwitchReflectionTest.php @@ -0,0 +1,28 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__ . '/FixtureMatchToSwitchReflection'); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config/match_to_switch_reflection.php'; + } +} diff --git a/tests/Issues/ScopeNotAvailable/config/match_to_switch_reflection.php b/tests/Issues/ScopeNotAvailable/config/match_to_switch_reflection.php new file mode 100644 index 00000000..b906042b --- /dev/null +++ b/tests/Issues/ScopeNotAvailable/config/match_to_switch_reflection.php @@ -0,0 +1,10 @@ +withRules([DowngradeSetAccessibleReflectionPropertyRector::class, DowngradeMatchToSwitchRector::class]);