summaryrefslogtreecommitdiff
path: root/tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php
blob: 6cc3a4daa2066d179b6b125bd721a903b75bd919 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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);
    }
}