/** * @When /^I login$/ */ public function iLogin() { try { $this->userSession = $this->authenticationManager->login($this->user); } catch (Exception $ex) { $this->lastException = $ex; } }
/** * @test */ public function shouldLogout() { $userSession = $this->mockUserSession(); $this->userSessionRepository->shouldReceive('delete')->once()->with($userSession); $this->manager->logout($userSession); }