-
- protected function createValidContainerMockSet(): void
- {
- $pageBuilder = $this->createMock(PageBuilder::class);
- $pageBuilder
- ->method('assign')
- ->willReturnCallback(function (string $key, $value): void {
- $this->assignedValues[$key] = $value;
- });
- $pageBuilder
- ->method('render')
- ->willReturnCallback(function (string $template): string {
- return $template;
- });
- $this->container->pageBuilder = $pageBuilder;
-
- $bookmarkService = $this->createMock(BookmarkServiceInterface::class);
- $bookmarkService
- ->method('count')
- ->willReturnCallback(function (string $visibility): int {
- return $visibility === BookmarkFilter::$PRIVATE ? 5 : 10;
- });
- $this->container->bookmarkService = $bookmarkService;
-
- $pluginManager = $this->createMock(PluginManager::class);
- $pluginManager
- ->method('executeHooks')
- ->willReturnCallback(function (string $hook, array &$data, array $params): array {
- return $data[$hook] = $params;
- });
- $pluginManager->method('getErrors')->willReturn(['error']);
- $this->container->pluginManager = $pluginManager;
-
- $loginManager = $this->createMock(LoginManager::class);
- $loginManager->method('isLoggedIn')->willReturn(true);
- $this->container->loginManager = $loginManager;
- }