bug #16954 [TranslationUpdateCommand] fixed undefined resultMessage var. (aitboudad)
This PR was merged into the 2.8 branch.
Discussion
----------
[TranslationUpdateCommand] fixed undefined resultMessage var.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #16950
| License | MIT
| Doc PR | n/a
Commits
-------
1999e89
[TranslationUpdateCommand] fixed undefined resultMessage var.
This commit is contained in:
commit
c5ae309592
@ -150,6 +150,8 @@ EOF
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$resultMessage = 'Translation files were successfully updated.';
|
||||||
|
|
||||||
// show compiled list of messages
|
// show compiled list of messages
|
||||||
if (true === $input->getOption('dump-messages')) {
|
if (true === $input->getOption('dump-messages')) {
|
||||||
$extractedMessagesCount = 0;
|
$extractedMessagesCount = 0;
|
||||||
@ -205,8 +207,6 @@ EOF
|
|||||||
|
|
||||||
if (true === $input->getOption('dump-messages')) {
|
if (true === $input->getOption('dump-messages')) {
|
||||||
$resultMessage .= ' and translation files were updated.';
|
$resultMessage .= ' and translation files were updated.';
|
||||||
} else {
|
|
||||||
$resultMessage = 'Translation files were successfully updated.';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,14 @@ class TranslationUpdateCommandTest extends \PHPUnit_Framework_TestCase
|
|||||||
$tester = $this->createCommandTester($this->getContainer(array('foo' => 'foo')));
|
$tester = $this->createCommandTester($this->getContainer(array('foo' => 'foo')));
|
||||||
$tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true));
|
$tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true));
|
||||||
$this->assertRegExp('/foo/', $tester->getDisplay());
|
$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()
|
protected function setUp()
|
||||||
|
Reference in New Issue
Block a user