diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php index d560975048..6ebbbf4821 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php @@ -150,6 +150,8 @@ EOF return; } + $resultMessage = 'Translation files were successfully updated.'; + // show compiled list of messages if (true === $input->getOption('dump-messages')) { $extractedMessagesCount = 0; @@ -205,8 +207,6 @@ EOF if (true === $input->getOption('dump-messages')) { $resultMessage .= ' and translation files were updated.'; - } else { - $resultMessage = 'Translation files were successfully updated.'; } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php index a04a0cccad..f7eca9d366 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php @@ -28,6 +28,14 @@ class TranslationUpdateCommandTest extends \PHPUnit_Framework_TestCase $tester = $this->createCommandTester($this->getContainer(array('foo' => 'foo'))); $tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true)); $this->assertRegExp('/foo/', $tester->getDisplay()); + $this->assertRegExp('/2 messages were successfully extracted/', $tester->getDisplay()); + } + + public function testWriteMessages() + { + $tester = $this->createCommandTester($this->getContainer(array('foo' => 'foo'))); + $tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true)); + $this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay()); } protected function setUp()