logger = $this->createMock(LoggerInterface::class); $this->dispatcher = $this->createMock(IEventDispatcher::class); $this->cmd = new LoggedInCheckCommand( $this->logger, $this->dispatcher ); } public function testProcessSuccessfulLogin(): void { $data = $this->getLoggedInLoginData(); $result = $this->cmd->process($data); $this->assertTrue($result->isSuccess()); } public function testProcessFailedLogin(): void { $data = $this->getFailedLoginData(); $this->logger->expects($this->once()) ->method('warning'); $result = $this->cmd->process($data); $this->assertFalse($result->isSuccess()); $this->assertSame(LoginController::LOGIN_MSG_INVALIDPASSWORD, $result->getErrorMessage()); } }