Definition at line 11 of file TemplateWrapperTest.php.
◆ testDisplayBlock()
Twig_Tests_TemplateWrapperTest::testDisplayBlock |
( |
| ) |
|
Definition at line 50 of file TemplateWrapperTest.php.
References array.
53 'index' =>
'{% block foo %}{{ foo }}{{ bar }}{% endblock %}',
55 $twig->addGlobal(
'bar',
'BAR');
60 $wrapper->displayBlock(
'foo',
array(
'foo' =>
'FOO'));
62 $this->assertEquals(
'FOOBAR', ob_get_clean());
Exposes a template to userland.
Create styles array
The data for the language used.
Stores the Twig configuration.
Loads a template from an array.
◆ testHasGetBlocks()
Twig_Tests_TemplateWrapperTest::testHasGetBlocks |
( |
| ) |
|
Definition at line 13 of file TemplateWrapperTest.php.
References array.
16 'index' =>
'{% block foo %}{% endblock %}',
17 'index_with_use' =>
'{% use "imported" %}{% block foo %}{% endblock %}',
18 'index_with_extends' =>
'{% extends "extended" %}{% block foo %}{% endblock %}',
19 'imported' =>
'{% block imported %}{% endblock %}',
20 'extended' =>
'{% block extended %}{% endblock %}',
24 $this->assertTrue($wrapper->hasBlock(
'foo'));
25 $this->assertFalse($wrapper->hasBlock(
'bar'));
26 $this->assertEquals(
array(
'foo'), $wrapper->getBlockNames());
29 $this->assertTrue($wrapper->hasBlock(
'foo'));
30 $this->assertTrue($wrapper->hasBlock(
'imported'));
31 $this->assertEquals(
array(
'imported',
'foo'), $wrapper->getBlockNames());
34 $this->assertTrue($wrapper->hasBlock(
'foo'));
35 $this->assertTrue($wrapper->hasBlock(
'extended'));
36 $this->assertEquals(
array(
'foo',
'extended'), $wrapper->getBlockNames());
Exposes a template to userland.
Create styles array
The data for the language used.
Stores the Twig configuration.
Loads a template from an array.
◆ testRenderBlock()
Twig_Tests_TemplateWrapperTest::testRenderBlock |
( |
| ) |
|
Definition at line 39 of file TemplateWrapperTest.php.
References array.
42 'index' =>
'{% block foo %}{{ foo }}{{ bar }}{% endblock %}',
44 $twig->addGlobal(
'bar',
'BAR');
47 $this->assertEquals(
'FOOBAR', $wrapper->renderBlock(
'foo',
array(
'foo' =>
'FOO')));
Exposes a template to userland.
Create styles array
The data for the language used.
Stores the Twig configuration.
Loads a template from an array.
The documentation for this class was generated from the following file: