[TranslationUpdateCommand] fixed undefined resultMessage var.

This commit is contained in:
Abdellatif Ait boudad 2015-12-10 19:14:16 +00:00
parent 829c011b49
commit 1999e89e7c
2 changed files with 10 additions and 2 deletions

View File

@ -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.';
}
}

View File

@ -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()