summaryrefslogtreecommitdiff
path: root/tests/Unit/Renderer/Twig/Extensions/SessionTest.php
blob: 7ce4dc3ad5836fd652803c40a3f738296da76d8c (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\Session;
use PHPUnit\Framework\MockObject\MockObject;
use Symfony\Component\HttpFoundation\Session\Session as SymfonySession;

class SessionTest extends ExtensionTest
{
    /**
     * @covers \Engelsystem\Renderer\Twig\Extensions\Session::__construct
     * @covers \Engelsystem\Renderer\Twig\Extensions\Session::getFunctions
     */
    public function testGetGlobals()
    {
        /** @var SymfonySession|MockObject $session */
        $session = $this->createMock(SymfonySession::class);

        $extension = new Session($session);
        $functions = $extension->getFunctions();

        $this->assertExtensionExists('session_get', [$session, 'get'], $functions);
    }
}