You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TagTest.php 725B

1234567891011121314151617181920212223
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. class Twig_Tests_Grammar_TagTest extends PHPUnit_Framework_TestCase
  11. {
  12. public function testMagicToString()
  13. {
  14. $grammar = new Twig_Extensions_Grammar_Tag(
  15. new Twig_Extensions_Grammar_Constant('foo'),
  16. new Twig_Extensions_Grammar_Number('bar'),
  17. new Twig_Extensions_Grammar_Optional(new Twig_Extensions_Grammar_Constant('foo'), new Twig_Extensions_Grammar_Number('bar'))
  18. );
  19. $this->assertEquals('foo <bar:number> [foo <bar:number>]', (string) $grammar);
  20. }
  21. }