mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-20 14:36:57 +00:00
Make Node::__toString() more readable
This commit is contained in:
@@ -15,6 +15,9 @@ use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
|
||||
use Twig\Node\NameDeprecation;
|
||||
use Twig\Node\Node;
|
||||
use Twig\TwigFilter;
|
||||
use Twig\TwigFunction;
|
||||
use Twig\TwigTest;
|
||||
|
||||
class NodeTest extends TestCase
|
||||
{
|
||||
@@ -28,6 +31,17 @@ class NodeTest extends TestCase
|
||||
$this->assertEquals('Twig\Node\Node(value: \Closure)', (string) $node);
|
||||
}
|
||||
|
||||
public function testToStringWithTwigCallables()
|
||||
{
|
||||
$node = new Node([], [
|
||||
'function' => new TwigFunction('a_function'),
|
||||
'filter' => new TwigFilter('a_filter'),
|
||||
'test' => new TwigTest('a_test'),
|
||||
], 1);
|
||||
|
||||
$this->assertEquals('Twig\Node\Node(function: Twig\TwigFunction(a_function), filter: Twig\TwigFilter(a_filter), test: Twig\TwigTest(a_test))', (string) $node);
|
||||
}
|
||||
|
||||
public function testAttributeDeprecationIgnore()
|
||||
{
|
||||
$node = new Node([], ['foo' => false]);
|
||||
|
||||
Reference in New Issue
Block a user