summaryrefslogtreecommitdiff
path: root/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-09-02 02:09:56 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-09-02 02:09:56 +0200
commit9e217d87c095170460a8580d5215ddf7cbe639f4 (patch)
tree3b426fe52e70ef0f1395edcb354f1be4788ca329 /tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
parentac48332166ce28fcb1a2fc130c7f5adbc760e42d (diff)
Template refactoring to use twig
Diffstat (limited to 'tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php')
-rw-r--r--tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php b/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
index e1c5a378..ef7dba7a 100644
--- a/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
+++ b/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
@@ -2,8 +2,10 @@
namespace Engelsystem\Test\Unit\Renderer\Twig\Extensions;
+use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Twig_Function as TwigFunction;
+use Twig_Node as TwigNode;
abstract class ExtensionTest extends TestCase
{
@@ -35,7 +37,7 @@ abstract class ExtensionTest extends TestCase
* @param callable $callback
* @param TwigFunction[] $functions
*/
- protected function assertExtensionExists($name, $callback, $functions)
+ protected function assertExtensionExists($name, $callback, $functions, $options = [])
{
foreach ($functions as $function) {
if ($function->getName() != $name) {
@@ -43,6 +45,14 @@ abstract class ExtensionTest extends TestCase
}
$this->assertEquals($callback, $function->getCallable());
+
+ if (isset($options['is_save'])) {
+ /** @var TwigNode|MockObject $twigNode */
+ $twigNode = $this->createMock(TwigNode::class);
+
+ $this->assertArraySubset($options['is_save'], $function->getSafe($twigNode));
+ }
+
return;
}