1
0
Fork 0

Use writeError for xdebug warning and fix running test suite with xdebug

pull/4621/head
Jordi Boggiano 2015-11-19 17:36:52 +00:00
parent d98b134dc3
commit cf6cd83335
2 changed files with 15 additions and 8 deletions

View File

@ -112,7 +112,7 @@ class Application extends BaseApplication
}
if (extension_loaded('xdebug')) {
$io->write('<warning>You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug</warning>');
$io->writeError('<warning>You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug</warning>');
}
if (defined('COMPOSER_DEV_WARNING_TIME')) {

View File

@ -28,7 +28,14 @@ class ApplicationTest extends TestCase
->method('getFirstArgument')
->will($this->returnValue('list'));
$outputMock->expects($this->once())
$index = 0;
if (extension_loaded('xdebug')) {
$outputMock->expects($this->at($index++))
->method("write")
->with($this->equalTo('<warning>You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug</warning>'));
}
$outputMock->expects($this->at($index++))
->method("write")
->with($this->equalTo(sprintf('<warning>Warning: This development build of composer is over 60 days old. It is recommended to update it by running "%s self-update" to get the latest version.</warning>', $_SERVER['PHP_SELF'])));