BlockReferenceTest.php 994B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. require_once dirname(__FILE__).'/TestCase.php';
  11. class Twig_Tests_Node_BlockReferenceTest extends Twig_Tests_Node_TestCase
  12. {
  13. /**
  14. * @covers Twig_Node_BlockReference::__construct
  15. */
  16. public function testConstructor()
  17. {
  18. $node = new Twig_Node_BlockReference('foo', 0);
  19. $this->assertEquals('foo', $node->getAttribute('name'));
  20. }
  21. /**
  22. * @covers Twig_Node_BlockReference::compile
  23. * @dataProvider getTests
  24. */
  25. public function testCompile($node, $source, $environment = null)
  26. {
  27. parent::testCompile($node, $source, $environment);
  28. }
  29. public function getTests()
  30. {
  31. return array(
  32. array(new Twig_Node_BlockReference('foo', 0), '$this->displayBlock(\'foo\', $context, $blocks);'),
  33. );
  34. }
  35. }