diff --git a/tests/Composer/Test/Downloader/ZipDownloaderTest.php b/tests/Composer/Test/Downloader/ZipDownloaderTest.php index ced6c0992..80e9378d9 100644 --- a/tests/Composer/Test/Downloader/ZipDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ZipDownloaderTest.php @@ -65,11 +65,7 @@ class ZipDownloaderTest extends TestCase $reflectionClass = new \ReflectionClass('Composer\Downloader\ZipDownloader'); $reflectedProperty = $reflectionClass->getProperty($name); $reflectedProperty->setAccessible(true); - if ($obj === null) { - $reflectedProperty->setValue($value); - } else { - $reflectedProperty->setValue($obj, $value); - } + $reflectedProperty->setValue($obj, $value); } public function testErrorMessages(): void diff --git a/tests/Composer/Test/InstalledVersionsTest.php b/tests/Composer/Test/InstalledVersionsTest.php index 6edd91e04..c227675ca 100644 --- a/tests/Composer/Test/InstalledVersionsTest.php +++ b/tests/Composer/Test/InstalledVersionsTest.php @@ -33,14 +33,14 @@ class InstalledVersionsTest extends TestCase $prop = new \ReflectionProperty('Composer\Autoload\ClassLoader', 'registeredLoaders'); $prop->setAccessible(true); self::$previousRegisteredLoaders = $prop->getValue(); - $prop->setValue([]); + $prop->setValue(null, []); } public static function tearDownAfterClass(): void { $prop = new \ReflectionProperty('Composer\Autoload\ClassLoader', 'registeredLoaders'); $prop->setAccessible(true); - $prop->setValue(self::$previousRegisteredLoaders); + $prop->setValue(null, self::$previousRegisteredLoaders); InstalledVersions::reload(null); // @phpstan-ignore-line }