3 declare(strict_types
=1);
5 namespace Shaarli\Front\Controller\Admin
;
7 use Shaarli\Container\ShaarliTestContainer
;
8 use Shaarli\Front\Controller\Visitor\FrontControllerMockHelper
;
11 * Trait FrontControllerMockHelper
13 * Helper trait used to initialize the ShaarliContainer and mock its services for admin controller tests.
15 * @property ShaarliTestContainer $container
17 trait FrontAdminControllerMockHelper
19 use FrontControllerMockHelper
{
20 FrontControllerMockHelper
::createContainer
as parentCreateContainer
;
24 * Mock the container instance
26 protected function createContainer(): void
28 $this->parentCreateContainer();
30 $this->container
->loginManager
->method('isLoggedIn')->willReturn(true);
31 $this->container
->sessionManager
->method('checkToken')->willReturn(true);