public function parse(Session $session)
    {
        if ( ! $session->isStarted()) {
            throw new \BadMethodCallException(
                'The Mink session must be started before '.__METHOD__
            );
        }

        $content_type = $session->getResponseHeader('Content-Type');
        if ($this->isCSVContentType($content_type)) {
            throw new ExpectationException(
                'Expected Content-Type of "text/csv" but got '.$content_type, $session->getDriver()
            );
        }

        $response_text = $session->getDriver()->getContent();
        if ($this->isLikeHTML($response_text)) {
            throw new ResponseTextException(
                'Response text content looks like HTML but CSV data was expected',
                $session->getDriver()
            );
        }

        return $this->csv_parser->parse($response_text);
    }
public function parse(Session $session)
    {
        if ( ! $session->isStarted()) {
            throw new \BadMethodCallException(
                'The Mink session must be started before '.__METHOD__
            );
        }

        $content_type = $session->getResponseHeader('Content-Type');
        if ($this->isCSVContentType($content_type)) {
            throw new ExpectationException(
                'Expected Content-Type of "text/csv" but got '.$content_type, $session->getDriver()
            );
        }

        $response_text = $session->getDriver()->getContent();
        if ($this->isLikeHTML($response_text)) {
            throw new ResponseTextException(
                'Response text content looks like HTML but CSV data was expected',
                $session->getDriver()
            );
        }

        return $this->csv_parser->parse($response_text);
    }
@param \Behat\Mink\Session $session

@return \Behat\Gherkin\Node\TableNode
@throws \Behat\Mink\Exception\ExpectationException
@throws \Behat\Mink\Exception\ResponseTextException