4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\ExpressionLanguage\Tests\Node;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\ExpressionLanguage\Node\Node;
16 use Symfony\Component\ExpressionLanguage\Node\ConstantNode;
18 class NodeTest extends TestCase
20 public function testToString()
22 $node = new Node(array(new ConstantNode('foo')));
24 $this->assertEquals(<<<'EOF'
26 ConstantNode(value: 'foo')
32 public function testSerialization()
34 $node = new Node(array('foo' => 'bar'), array('bar' => 'foo'));
36 $serializedNode = serialize($node);
37 $unserializedNode = unserialize($serializedNode);
39 $this->assertEquals($node, $unserializedNode);