]>
Commit | Line | Data |
---|---|---|
2899ebb5 A |
1 | <?php |
2 | ||
3 | declare(strict_types=1); | |
4 | ||
5 | namespace Shaarli\Front\Controller\Admin; | |
6 | ||
7 | use Shaarli\Container\ShaarliTestContainer; | |
8 | use Shaarli\Front\Controller\Visitor\FrontControllerMockHelper; | |
2899ebb5 A |
9 | |
10 | /** | |
11 | * Trait FrontControllerMockHelper | |
12 | * | |
13 | * Helper trait used to initialize the ShaarliContainer and mock its services for admin controller tests. | |
14 | * | |
15 | * @property ShaarliTestContainer $container | |
16 | */ | |
17 | trait FrontAdminControllerMockHelper | |
18 | { | |
19 | use FrontControllerMockHelper { | |
20 | FrontControllerMockHelper::createContainer as parentCreateContainer; | |
21 | } | |
22 | ||
23 | /** | |
24 | * Mock the container instance | |
25 | */ | |
26 | protected function createContainer(): void | |
27 | { | |
28 | $this->parentCreateContainer(); | |
29 | ||
2899ebb5 | 30 | $this->container->loginManager->method('isLoggedIn')->willReturn(true); |
ef00f9d2 | 31 | $this->container->sessionManager->method('checkToken')->willReturn(true); |
2899ebb5 A |
32 | } |
33 | } |