8000 [TranslationUpdateCommand] fixed undefined resultMessage var. · symfony/symfony@1999e89 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1999e89

Browse files
committed
[TranslationUpdateCommand] fixed undefined resultMessage var.
1 parent 829c011 commit 1999e89

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
150150
return;
151151
}
152152

153+
$resultMessage = 'Translation files were successfully updated.';
154+
153155
// show compiled list of messages
154156
if (true === $input->getOption('dump-messages')) {
155157
$extractedMessagesCount = 0;
@@ -205,8 +207,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
205207

206208
if (true === $input->getOption('dump-messages')) {
207209
$resultMessage .= ' and translation files were updated.';
208-
} else {
209-
$resultMessage = 'Translation files were successfully updated.';
210210
}
211211
}
212212

src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ public function testDumpMessagesAndClean()
2828
$tester = $this->createCommandTester($this->getContainer(array('foo' => 'foo')));
2929
$tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true));
3030
$this->assertRegExp('/foo/', $tester->getDisplay());
31+
$this->assertRegExp('/2 messages were successfully extracted/', $tester->getDisplay());
32+
}
33+
34+
public function testWriteMessages()
35+
{
36+
$tester = $this->createCommandTester($this->getContainer(array('foo' => 'foo')));
37+
$tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true));
38+
$this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
3139
}
3240

3341
protected function setUp()

0 commit comments

Comments
 (0)
0