2828use Foxy \Tests \Fixtures \Asset \StubAssetManager ;
2929use PHPUnit \Framework \MockObject \MockObject ;
3030
31+ use const PHP_VERSION_ID ;
32+
3133final class FoxyTest extends \PHPUnit \Framework \TestCase
3234{
3335 private Composer |MockObject $ composer ;
@@ -145,14 +147,21 @@ public function testActivateBuildsAssetFallbackWithResolvedRootPackagePath(): vo
145147
146148 $ foxyReflection = new \ReflectionClass ($ foxy );
147149 $ assetFallbackProperty = $ foxyReflection ->getProperty ('assetFallback ' );
148- $ assetFallbackProperty ->setAccessible (true );
150+
151+ if (PHP_VERSION_ID < 80500 ) {
152+ $ assetFallbackProperty ->setAccessible (true );
153+ }
154+
149155 $ assetFallback = $ assetFallbackProperty ->getValue ($ foxy );
150156
151157 $ this ->assertInstanceOf (\Foxy \Fallback \AssetFallback::class, $ assetFallback );
152158
153159 $ fallbackReflection = new \ReflectionClass ($ assetFallback );
154160 $ pathProperty = $ fallbackReflection ->getProperty ('path ' );
155- $ pathProperty ->setAccessible (true );
161+
162+ if (PHP_VERSION_ID < 80500 ) {
163+ $ pathProperty ->setAccessible (true );
164+ }
156165
157166 $ expectedPath = rtrim ((string ) \getcwd (), '/ \\' )
158167 . DIRECTORY_SEPARATOR
@@ -172,7 +181,11 @@ public function testActivateUsesPackageNameForNonAbstractAssetManager(): void
172181
173182 $ foxyReflection = new \ReflectionClass (Foxy::class);
174183 $ assetManagersProperty = $ foxyReflection ->getProperty ('assetManagers ' );
175- $ assetManagersProperty ->setAccessible (true );
184+
185+ if (PHP_VERSION_ID < 80500 ) {
186+ $ assetManagersProperty ->setAccessible (true );
187+ }
188+
176189 $ originalAssetManagers = $ assetManagersProperty ->getValue ();
177190 $ assetManagersProperty ->setValue (null , [StubAssetManager::class]);
178191
@@ -181,12 +194,20 @@ public function testActivateUsesPackageNameForNonAbstractAssetManager(): void
181194 $ foxy ->activate ($ this ->composer , $ this ->io );
182195
183196 $ assetFallbackProperty = $ foxyReflection ->getProperty ('assetFallback ' );
184- $ assetFallbackProperty ->setAccessible (true );
197+
198+ if (PHP_VERSION_ID < 80500 ) {
199+ $ assetFallbackProperty ->setAccessible (true );
200+ }
201+
185202 $ assetFallback = $ assetFallbackProperty ->getValue ($ foxy );
186203
187204 $ fallbackReflection = new \ReflectionClass ($ assetFallback );
205+
188206 $ pathProperty = $ fallbackReflection ->getProperty ('path ' );
189- $ pathProperty ->setAccessible (true );
207+
208+ if (PHP_VERSION_ID < 80500 ) {
209+ $ pathProperty ->setAccessible (true );
210+ }
190211
191212 $ this ->assertSame ('stub-package.json ' , $ pathProperty ->getValue ($ assetFallback ));
192213 } finally {
0 commit comments