engelsystem/tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php

27 lines
630 B
PHP
Raw Normal View History

2018-08-26 12:23:47 +02:00
<?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()
{
2018-09-02 02:09:56 +02:00
global $user;
$user = [];
$extension = new Globals();
2018-09-02 02:09:56 +02:00
2018-08-26 12:23:47 +02:00
$globals = $extension->getGlobals();
$this->assertGlobalsExists('user', [], $globals);
$user['foo'] = 'bar';
$globals = $extension->getGlobals();
$this->assertGlobalsExists('user', ['foo' => 'bar'], $globals);
}
}