class Twig_Tests_Node_BlockTest

Hierarchy

Expanded class hierarchy of Twig_Tests_Node_BlockTest

File

drupal/core/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php, line 14

View source
class Twig_Tests_Node_BlockTest extends Twig_Tests_Node_TestCase {

  /**
   * @covers Twig_Node_Block::__construct
   */
  public function testConstructor() {
    $body = new Twig_Node_Text('foo', 0);
    $node = new Twig_Node_Block('foo', $body, 0);
    $this
      ->assertEquals($body, $node
      ->getNode('body'));
    $this
      ->assertEquals('foo', $node
      ->getAttribute('name'));
  }

  /**
   * @covers Twig_Node_Block::compile
   * @dataProvider getTests
   */
  public function testCompile($node, $source, $environment = null) {
    parent::testCompile($node, $source, $environment);
  }
  public function getTests() {
    $body = new Twig_Node_Text('foo', 0);
    $node = new Twig_Node_Block('foo', $body, 0);
    return array(
      array(
        $node,
        <<<EOF
public function block_foo(\$context, array \$blocks = array())
{
    echo "foo";
}
EOF
,
      ),
    );
  }

}

Members