/** * @param User $user * @return bool */ public function isLogged(User $user) : bool { $userSession = $this->userSessionRepository->getByUser($user); return $userSession !== null; }
/** * @Then /^the user is not logged$/ */ public function theUserIsNotLogged() { PHPUnit::assertNotNull($this->user); $userSession = $this->userSessionRepository->getByUser($this->user); PHPUnit::assertNull($userSession); }