Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[TwigBridge] fixed trans twig extractor #7206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Prev Previous commit
Next Next commit
[TwigBridge] added message extraction with invalid domain node test
  • Loading branch information
jfsimon committed Feb 27, 2013
commit 0923e1d895fa1e25293386e901b9f7ff891c0cf9
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ public function testMessagesExtraction(\Twig_Node $node, array $expectedMessages
$this->assertEquals($expectedMessages, $visitor->getMessages());
}

public function testMessageExtractionWithInvalidDomainNode()
{
$message = 'new key';

$node = new \Twig_Node_Expression_Filter(
new \Twig_Node_Expression_Constant($message, 0),
new \Twig_Node_Expression_Constant('trans', 0),
new \Twig_Node(array(
new \Twig_Node_Expression_Array(array(), 0),
new \Twig_Node_Expression_Name('variable', 0),
)),
0
);

$this->testMessagesExtraction($node, array(array($message, TranslationNodeVisitor::UNDEFINED_DOMAIN)));
}

public function getMessagesExtractionTestData()
{
$message = 'new key';
Expand Down