|
13 | 13 |
|
14 | 14 | use Symfony\Component\Templating\PhpEngine;
|
15 | 15 | use Symfony\Component\Templating\Loader\Loader;
|
16 |
| -use Symfony\Component\Templating\Storage\Storage; |
17 | 16 | use Symfony\Component\Templating\Storage\StringStorage;
|
18 | 17 | use Symfony\Component\Templating\Helper\SlotsHelper;
|
19 | 18 | use Symfony\Component\Templating\TemplateNameParser;
|
@@ -126,10 +125,14 @@ public function testEscape()
|
126 | 125 |
|
127 | 126 | public function testGetSetCharset()
|
128 | 127 | {
|
129 |
| - $engine = new ProjectTemplateEngine(new TemplateNameParser(), $this->loader); |
130 |
| - $this->assertEquals('UTF-8', $engine->getCharset(), '->getCharset() returns UTF-8 by default'); |
| 128 | + $helper = new SlotsHelper(); |
| 129 | + $engine = new ProjectTemplateEngine(new TemplateNameParser(), $this->loader, array($helper)); |
| 130 | + $this->assertEquals('UTF-8', $engine->getCharset(), 'EngineInterface::getCharset() returns UTF-8 by default'); |
| 131 | + $this->assertEquals('UTF-8', $helper->getCharset(), 'HelperInterface::getCharset() returns UTF-8 by default'); |
| 132 | + |
131 | 133 | $engine->setCharset('ISO-8859-1');
|
132 |
| - $this->assertEquals('ISO-8859-1', $engine->getCharset(), '->setCharset() changes the default charset to use'); |
| 134 | + $this->assertEquals('ISO-8859-1', $engine->getCharset(), 'EngineInterface::setCharset() changes the default charset to use'); |
| 135 | + $this->assertEquals('ISO-8859-1', $helper->getCharset(), 'EngineInterface::setCharset() changes the default charset of helper'); |
133 | 136 | }
|
134 | 137 |
|
135 | 138 | public function testGlobalVariables()
|
|
0 commit comments