mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Report multiple inis in php.ini specific messages
Where systems use multiple ini files it is perhaps more useful to suggest running `php --ini` to see their locations, rather than showing the loaded php.ini (if one exists).
This commit is contained in:
parent
a691a179e5
commit
b0922b95af
2 changed files with 42 additions and 6 deletions
|
@ -21,7 +21,18 @@ class IniHelperTest extends \PHPUnit_Framework_TestCase
|
|||
{
|
||||
public static $envOriginal;
|
||||
|
||||
public function testWithLoadedIni()
|
||||
public function testWithNoIni()
|
||||
{
|
||||
$paths = array(
|
||||
'',
|
||||
);
|
||||
|
||||
$this->setEnv($paths);
|
||||
$this->assertContains('does not exist', IniHelper::getMessage());
|
||||
$this->assertEquals($paths, IniHelper::getAll());
|
||||
}
|
||||
|
||||
public function testWithLoadedIniOnly()
|
||||
{
|
||||
$paths = array(
|
||||
'loaded.ini',
|
||||
|
@ -32,7 +43,20 @@ class IniHelperTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals($paths, IniHelper::getAll());
|
||||
}
|
||||
|
||||
public function testWithoutLoadedIni()
|
||||
public function testWithLoadedIniAndAdditional()
|
||||
{
|
||||
$paths = array(
|
||||
'loaded.ini',
|
||||
'one.ini',
|
||||
'two.ini',
|
||||
);
|
||||
|
||||
$this->setEnv($paths);
|
||||
$this->assertContains('multiple ini files', IniHelper::getMessage());
|
||||
$this->assertEquals($paths, IniHelper::getAll());
|
||||
}
|
||||
|
||||
public function testWithoutLoadedIniAndAdditional()
|
||||
{
|
||||
$paths = array(
|
||||
'',
|
||||
|
@ -41,7 +65,7 @@ class IniHelperTest extends \PHPUnit_Framework_TestCase
|
|||
);
|
||||
|
||||
$this->setEnv($paths);
|
||||
$this->assertContains('does not exist', IniHelper::getMessage());
|
||||
$this->assertContains('multiple ini files', IniHelper::getMessage());
|
||||
$this->assertEquals($paths, IniHelper::getAll());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue