Behat\RestTestingContext\RestContext::theResponseHasAField PHP Method

theResponseHasAField() public method

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