public function theResponseHasAField($name) { if (!array_key_exists($name, $this->getResponseData())) { throw new Exception("Field '{$name}' not found in response."); } }