private static string
$message = 'message';
private static string
$domain = 'domain';
/** @dataProvider getDefaultDomainAssignmentTestData */
public function testDefaultDomainAssignment(Node
$node) { $env =
new Environment($this->
createMock(LoaderInterface::
class),
['cache' => false, 'autoescape' => false, 'optimizations' => 0
]);
$visitor =
new TranslationDefaultDomainNodeVisitor();
// visit trans_default_domain tag
$defaultDomain = TwigNodeProvider::
getTransDefaultDomainTag(self::
$domain);
$visitor->
enterNode($defaultDomain,
$env);
$visitor->
leaveNode($defaultDomain,
$env);
// visit tested node
$enteredNode =
$visitor->
enterNode($node,
$env);
$leavedNode =
$visitor->
leaveNode($node,
$env);
$this->
assertSame($node,
$enteredNode);
$this->
assertSame($node,
$leavedNode);
// extracting tested node messages
$visitor =
new TranslationNodeVisitor();
$visitor->
enable();