Attempt fixing usage of InstalledVersions in tests
parent
4ce11ab4ab
commit
7591ef0084
|
@ -17,6 +17,8 @@ use Composer\Semver\VersionParser;
|
||||||
|
|
||||||
class InstalledVersionsTest extends TestCase
|
class InstalledVersionsTest extends TestCase
|
||||||
{
|
{
|
||||||
|
private static $previousRegisteredLoaders;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
@ -28,12 +30,16 @@ class InstalledVersionsTest extends TestCase
|
||||||
// class loaders are registered
|
// class loaders are registered
|
||||||
$prop = new \ReflectionProperty('Composer\Autoload\ClassLoader', 'registeredLoaders');
|
$prop = new \ReflectionProperty('Composer\Autoload\ClassLoader', 'registeredLoaders');
|
||||||
$prop->setAccessible(true);
|
$prop->setAccessible(true);
|
||||||
|
self::$previousRegisteredLoaders = $prop->getValue();
|
||||||
$prop->setValue(array());
|
$prop->setValue(array());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
{
|
{
|
||||||
self::setUpBeforeClass();
|
$prop = new \ReflectionProperty('Composer\Autoload\ClassLoader', 'registeredLoaders');
|
||||||
|
$prop->setAccessible(true);
|
||||||
|
$prop->setValue(self::$previousRegisteredLoaders);
|
||||||
|
InstalledVersions::reload(null); // @phpstan-ignore-line
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
|
|
Loading…
Reference in New Issue