use Symfony\Bridge\Twig\Node\DumpNode;
use Twig\Compiler;
use Twig\Environment;
use Twig\Loader\LoaderInterface;
use Twig\Node\Expression\NameExpression;
use Twig\Node\Node;
class DumpNodeTest extends TestCase
{ public function testNoVar() { $node =
new DumpNode('bar', null, 7
);
$env =
new Environment($this->
createMock(LoaderInterface::
class));
$compiler =
new Compiler($env);
$expected = <<<'EOTXT'
if ($this->env->isDebug()) {
$barvars = [];
foreach ($context as $barkey => $barval) {
if (!$barval instanceof \Twig\Template) {
$barvars[$barkey] = $barval;
}
}
// line 7
\Symfony\Component\VarDumper\VarDumper::dump($barvars);
}