use Twig\Node\Expression\ArrayExpression;
use Twig\Node\Expression\ConstantExpression;
use Twig\Node\Expression\FilterExpression;
use Twig\Node\Expression\NameExpression;
use Twig\Node\Node;
class TranslationNodeVisitorTest extends TestCase
{ /** @dataProvider getMessagesExtractionTestData */
public function testMessagesExtraction(Node
$node, array
$expectedMessages) { $env =
new Environment($this->
createMock(LoaderInterface::
class),
['cache' => false, 'autoescape' => false, 'optimizations' => 0
]);
$visitor =
new TranslationNodeVisitor();
$visitor->
enable();
$visitor->
enterNode($node,
$env);
$visitor->
leaveNode($node,
$env);
$this->
assertEquals($expectedMessages,
$visitor->
getMessages());
} public function testMessageExtractionWithInvalidDomainNode() { $message = 'new key';