summaryrefslogtreecommitdiff
path: root/tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-08-26 12:23:47 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-08-29 23:46:31 +0200
commitdf6360044b5c2396b2bee0dfa9e8d744bfa424d5 (patch)
tree177b81f1feca7b1b77b4cd20d006bc1820baba12 /tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php
parentbb3d16d273bb3e4552e4869dd22cb2c2d81f5387 (diff)
Added Twig template functions
Diffstat (limited to 'tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php')
-rw-r--r--tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php b/tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php
new file mode 100644
index 00000000..6cc3a4da
--- /dev/null
+++ b/tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Renderer\Twig\Extensions;
+
+use Engelsystem\Renderer\Twig\Extensions\Globals;
+
+class GlobalsTest extends ExtensionTest
+{
+ /**
+ * @covers \Engelsystem\Renderer\Twig\Extensions\Globals::getGlobals
+ */
+ public function testGetGlobals()
+ {
+ $extension = new Globals();
+ $globals = $extension->getGlobals();
+
+ $this->assertGlobalsExists('user', [], $globals);
+
+ global $user;
+ $user['foo'] = 'bar';
+
+ $globals = $extension->getGlobals();
+ $this->assertGlobalsExists('user', ['foo' => 'bar'], $globals);
+ }
+}