AwsInspector\Tests\Helper\CurlTest::getCurlObject PHP Method

getCurlObject() public method

public getCurlObject ( array $output = [], array $header = [], integer $returnVar ) : Curl
$output array
$header array
$returnVar integer
return AwsInspector\Helper\Curl
    public function getCurlObject(array $output = [], array $header = [], $returnVar = 0)
    {
        if (empty($output)) {
            $output = ['<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">', '<TITLE>301 Moved</TITLE></HEAD><BODY>', '<H1>301 Moved</H1>', 'The document has moved', '<A HREF="http://www.google.com/">here</A>.', '</BODY></HTML>', 'HTTP/1.1 301 Moved Permanently', 'Location: http://www.google.com/', 'Content-Type: text/html; charset=UTF-8', ' '];
        }
        $connectionMock = $this->getMockBuilder('\\AwsInspector\\Ssh\\Connection')->disableOriginalConstructor()->getMock();
        $connectionMock->method('exec')->willReturn(['returnVar' => $returnVar, 'output' => $output]);
        $curl = new \AwsInspector\Helper\Curl('http://google.com', $header, $connectionMock);
        $curl->doRequest();
        return $curl;
    }