SuiteCRM-Core/tests/unit/core/legacy/ClassicViewRoutingExclusionsHandlerTest.php
Dillon-Brown 674af51eea Update test namespaces
Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:42 +01:00

66 lines
1.8 KiB
PHP

<?php
namespace App\Tests\unit\core\legacy;
use App\Routes\LegacyHandler\ClassicViewRoutingExclusionsHandler;
use App\Tests\UnitTester;
use Codeception\Test\Unit;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
/**
* Class ClassicViewRoutingExclusionsHandlerTest
* @package App\Tests\unit\core\legacy
*/
class ClassicViewRoutingExclusionsHandlerTest extends Unit
{
/**
* @var UnitTester
*/
protected $tester;
/**
* @var ClassicViewRoutingExclusionsHandler
*/
protected $handler;
protected function _before(): void
{
$session = new Session(new MockArraySessionStorage('PHPSESSID'));
$session->start();
$projectDir = $this->tester->getProjectDir();
$legacyDir = $this->tester->getLegacyDir();
$legacySessionName = $this->tester->getLegacySessionName();
$defaultSessionName = $this->tester->getDefaultSessionName();
$legacyScope = $this->tester->getLegacyScope();
$this->handler = new ClassicViewRoutingExclusionsHandler(
$projectDir,
$legacyDir,
$legacySessionName,
$defaultSessionName,
$legacyScope,
$session
);
}
// tests
/**
* Test exclusion retrieval
*/
public function testGetExclusions(): void
{
$exclusions = $this->handler->get();
static::assertNotNull($exclusions);
static::assertIsArray($exclusions);
static::assertNotEmpty($exclusions);
static::assertArrayHasKey('any', $exclusions);
static::assertNotNull($exclusions['any']);
static::assertIsArray($exclusions['any']);
static::assertNotEmpty($exclusions['any']);
}
}