diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 53daf40ae2..219111737e 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -253,7 +253,7 @@ class Application ); } - return implode("\n", $messages); + return implode(PHP_EOL, $messages); } /** @@ -649,7 +649,7 @@ class Application } } - return implode("\n", $messages); + return implode(PHP_EOL, $messages); } $messages = array($this->getHelp(), ''); @@ -764,11 +764,13 @@ class Application $messages[] = str_repeat(' ', $len); - $output->writeln("\n"); + $output->writeln(""); + $output->writeln(""); foreach ($messages as $message) { $output->writeln(''.$message.''); } - $output->writeln("\n"); + $output->writeln(""); + $output->writeln(""); if (OutputInterface::VERBOSITY_VERBOSE === $output->getVerbosity()) { $output->writeln('Exception trace:'); @@ -792,7 +794,8 @@ class Application $output->writeln(sprintf(' %s%s%s() at %s:%s', $class, $type, $function, $file, $line)); } - $output->writeln("\n"); + $output->writeln(""); + $output->writeln(""); } } while ($e = $e->getPrevious()); diff --git a/tests/Symfony/Tests/Component/Console/ApplicationTest.php b/tests/Symfony/Tests/Component/Console/ApplicationTest.php index 5a5fa748bc..b24add6502 100644 --- a/tests/Symfony/Tests/Component/Console/ApplicationTest.php +++ b/tests/Symfony/Tests/Component/Console/ApplicationTest.php @@ -68,7 +68,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase public function testHelp() { $application = new Application(); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_gethelp.txt', $application->getHelp(), '->setHelp() returns a help message'); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_gethelp.txt', str_replace(PHP_EOL, "\n", $application->getHelp()), '->setHelp() returns a help message'); } public function testAll() diff --git a/tests/Symfony/Tests/Component/Console/Command/ListCommandTest.php b/tests/Symfony/Tests/Component/Console/Command/ListCommandTest.php index a21b78f65d..56f6ebc73a 100644 --- a/tests/Symfony/Tests/Component/Console/Command/ListCommandTest.php +++ b/tests/Symfony/Tests/Component/Console/Command/ListCommandTest.php @@ -33,6 +33,6 @@ help Displays help for a command list Lists commands EOF; - $this->assertEquals($output, $commandTester->getDisplay(), 'boo'); + $this->assertEquals(str_replace("\n", PHP_EOL, $output), $commandTester->getDisplay(), 'boo'); } }