protected function ensureResponseHasView()
    {
        if (! isset($this->view) || ! $this->view instanceof View) {
            return PHPUnit::fail('The response is not a view.');
        }

        return $this;
    }