private function createGerritApiForQuery($status, $json) { $changeId = $this->changeId; $commitHash = $this->commitHash; $this->gerritConfigs->expects($this->once())->method('reviewScore')->will($this->returnValue(10)); $this->gerritConfigs->expects($this->once())->method('verifiedScore')->will($this->returnValue(null)); $remoteGerritCmd = 'gerrit query --format=JSON ' . $changeId . " commit:{$commitHash} label:CodeReview=10"; $will = $status != 0 ? $this->throwException(new CommandException($status)) : $this->returnValue($json); return $this->configureApiForCmd($remoteGerritCmd, $will); }