createMock(IRequest::class); $initialStateService = $this->createMock(IInitialState::class); $profileManager = $this->createMock(ProfileManager::class); $shareManager = $this->createMock(IManager::class); $this->userManager = $this->createMock(IUserManager::class); $userSession = $this->createMock(IUserSession::class); $userStatusManager = $this->createMock(Manager::class); $navigationManager = $this->createMock(INavigationManager::class); $eventDispatcher = $this->createMock(IEventDispatcher::class); $this->controller = new ProfilePageController( 'core', $request, $initialStateService, $profileManager, $shareManager, $this->userManager, $userSession, $userStatusManager, $navigationManager, $eventDispatcher, ); } public function testUserNotFound(): void { $this->userManager->method('get') ->willReturn(null); $response = $this->controller->index('bob'); $this->assertTrue($response->isThrottled()); } public function testUserDisabled(): void { $user = $this->createMock(IUser::class); $user->method('isEnabled') ->willReturn(false); $this->userManager->method('get') ->willReturn($user); $response = $this->controller->index('bob'); $this->assertFalse($response->isThrottled()); } }