2018-08-26 12:23:47 +02:00
|
|
|
<?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
|
|
|
|
*/
|
2022-12-14 19:15:20 +01:00
|
|
|
public function testGetGlobals(): void
|
2018-08-26 12:23:47 +02:00
|
|
|
{
|
|
|
|
/** @var SymfonySession|MockObject $session */
|
|
|
|
$session = $this->createMock(SymfonySession::class);
|
|
|
|
|
|
|
|
$extension = new Session($session);
|
|
|
|
$functions = $extension->getFunctions();
|
|
|
|
|
|
|
|
$this->assertExtensionExists('session_get', [$session, 'get'], $functions);
|
2021-10-04 21:45:06 +02:00
|
|
|
$this->assertExtensionExists('session_set', [$session, 'set'], $functions);
|
2018-08-26 12:23:47 +02:00
|
|
|
}
|
|
|
|
}
|