diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-09-23 19:13:19 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2018-09-23 20:11:37 +0200 |
commit | 66038eda14d5d4e624b6636a6156570e3e940e49 (patch) | |
tree | 6e4b7557b7d91786ef47f22f7ddef85eed1dfb42 /tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php | |
parent | 590adffa9316b98544cb8d67b03b80e44ba9c8b7 (diff) | |
parent | 9d34f371cb9c5ab0d60bd3158678b9cc9da6cc80 (diff) |
Merge branch 'twig-templates'
Diffstat (limited to 'tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php')
-rw-r--r-- | tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php | 12 |
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; } |