Skip to content

Commit

Permalink
merged branch Seldaek/console_tests_2_0 (PR symfony#3066)
Browse files Browse the repository at this point in the history
Commits
-------

c9129e5 Fix Console tests on windows

Discussion
----------

Fix Console tests on windows (2.0)

Rebased symfony#3059 on 2.0 - once this is applied I will rebase it again because some of the fixes could not be applied to 2.0.
  • Loading branch information
fabpot committed Jan 9, 2012
2 parents b7a8f6d + c9129e5 commit 40053bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ public function asText($namespace = null)
}
}

return implode("\n", $messages);
return implode(PHP_EOL, $messages);
}

/**
Expand Down Expand Up @@ -781,7 +781,8 @@ public function renderException($e, $output)

if (null !== $this->runningCommand) {
$output->writeln(sprintf('<info>%s</info>', sprintf($this->runningCommand->getSynopsis(), $this->getName())));
$output->writeln("\n");
$output->writeln("");
$output->writeln("");
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Symfony/Tests/Component/Console/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ public function testAsText()
{
$application = new Application();
$application->add(new \FooCommand);
$this->assertStringEqualsFile(self::$fixturesPath.'/application_astext1.txt', $application->asText(), '->asText() returns a text representation of the application');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', $application->asText('foo'), '->asText() returns a text representation of the application');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_astext1.txt', str_replace(PHP_EOL, "\n", $application->asText()), '->asText() returns a text representation of the application');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', str_replace(PHP_EOL, "\n", $application->asText('foo')), '->asText() returns a text representation of the application');
}

public function testAsXml()
Expand Down

0 comments on commit 40053bc

Please sign in to comment.