_DiscoveryMockFetcher::get PHP Method

get() public method

public get ( $url, $headers = null, $body = null )
    function get($url, $headers = null, $body = null)
    {
        $this->fetchlog[] = array($url, $body, $headers);
        if ($this->redirect) {
            $final_url = $this->redirect;
        } else {
            $final_url = $url;
        }
        if (array_key_exists($url, $this->documents)) {
            list($ctype, $body) = $this->documents[$url];
            $status = 200;
        } else {
            $status = 404;
            $ctype = 'text/plain';
            $body = '';
        }
        return new Auth_Yadis_HTTPResponse($final_url, $status, array('content-type' => $ctype), $body);
    }