function testLogin() { $this->session->expects($this->any())->method('getStatus')->willReturn(PHP_SESSION_NONE); $dummyLogin = "******"; $this->authModel = $this->createMock(IAuthModel::class); $this->authModel->expects($this->any())->method('getLogin')->willReturn($dummyLogin); $this->session->expects($this->exactly(2))->method('register')->withConsecutive(array(SessionManager::USER_LOGIN, $dummyLogin), array(SessionManager::USER, $this->authModel)); $this->sessionManager->login($this->authModel); }