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 = [];
|
|
|
|
|
2018-09-25 17:33:31 +02:00
|
|
|
$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);
|
|
|
|
}
|
|
|
|
}
|