1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Use external XdebugHandler library

This commit is contained in:
johnstevenson 2017-11-23 15:52:48 +00:00
parent 4d8b9be5b6
commit ed97c2116c
10 changed files with 65 additions and 541 deletions

View file

@ -13,6 +13,7 @@
namespace Composer\Test\Util;
use Composer\Util\IniHelper;
use Composer\XdebugHandler\XdebugHandler;
use PHPUnit\Framework\TestCase;
/**
@ -41,7 +42,6 @@ class IniHelperTest extends TestCase
$this->setEnv($paths);
$this->assertContains('loaded.ini', IniHelper::getMessage());
$this->assertEquals($paths, IniHelper::getAll());
}
public function testWithLoadedIniAndAdditional()
@ -72,22 +72,24 @@ class IniHelperTest extends TestCase
public static function setUpBeforeClass()
{
// Register our name with XdebugHandler
$xdebug = new XdebugHandler('composer');
// Save current state
self::$envOriginal = getenv(IniHelper::ENV_ORIGINAL);
self::$envOriginal = getenv('COMPOSER_ORIGINAL_INIS');
}
public static function tearDownAfterClass()
{
// Restore original state
if (false !== self::$envOriginal) {
putenv(IniHelper::ENV_ORIGINAL.'='.self::$envOriginal);
putenv('COMPOSER_ORIGINAL_INIS='.self::$envOriginal);
} else {
putenv(IniHelper::ENV_ORIGINAL);
putenv('COMPOSER_ORIGINAL_INIS');
}
}
protected function setEnv(array $paths)
{
putenv(IniHelper::ENV_ORIGINAL.'='.implode(PATH_SEPARATOR, $paths));
putenv('COMPOSER_ORIGINAL_INIS='.implode(PATH_SEPARATOR, $paths));
}
}