- /**
- * Creating an instance of an admin controller while logged out should raise an exception.
- */
- public function testInstantiateWhileLoggedOut(): void
- {
- $this->expectException(UnauthorizedException::class);
-
- $this->container->loginManager = $this->createMock(LoginManager::class);
- $this->container->loginManager->method('isLoggedIn')->willReturn(false);
-
- $this->controller = new class($this->container) extends ShaarliAdminController {};
- }
-