/** * @test */ public function it_removes_the_minimal_user_info_when_logging_out() { $this->service->setMinimalUserInfo($this->minimalUserInfo); $this->service->logout(); $this->assertNull($this->service->getMinimalUserInfo()); $this->assertNull($this->service->getUser()); }
/** * @test */ public function it_grants_access_when_authenticated() { $this->userSessionService->setMinimalUserInfo($this->minimalUserInfo); $user = new User(); $user->id = $this->minimalUserInfo->getId(); $authToken = new UiTIDToken($user->getRoles()); $authToken->setUser($user); $this->authenticationManager->expects($this->once())->method('authenticate')->with($this->minimalToken)->willReturn($authToken); $this->tokenStorage->expects($this->once())->method('setToken')->with($authToken); // Make sure no Response is set, so the request can be handled by the // actual controllers. $this->event->expects($this->never())->method('setResponse'); $this->listener->handle($this->event); }