session = $this->createMock(Session::class); $this->cmd = new CompleteLoginCommand( $this->session ); } public function testProcess(): void { $data = $this->getLoggedInLoginData(); $this->session->expects($this->once()) ->method('completeLogin') ->with( $this->user, $this->equalTo( [ 'loginName' => $this->username, 'password' => $this->password, ] ) ); $result = $this->cmd->process($data); $this->assertTrue($result->isSuccess()); } }