|
|
|
|
|
|
|
|
'verify' => '/my/path.crt', |
|
|
'verify' => '/my/path.crt', |
|
|
'proxy' => 'foo', |
|
|
'proxy' => 'foo', |
|
|
'headers' => [ |
|
|
'headers' => [ |
|
|
'User-Agent' => 'Nextcloud Server Crawler' |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
'User-Agent' => 'Nextcloud Server Crawler', |
|
|
|
|
|
], |
|
|
|
|
|
'timeout' => 30, |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testGetWithOptions(): void { |
|
|
public function testGetWithOptions(): void { |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
|
|
|
|
|
|
$options = [ |
|
|
|
|
|
|
|
|
$options = array_merge($this->defaultRequestOptions, [ |
|
|
'verify' => false, |
|
|
'verify' => false, |
|
|
'proxy' => 'bar', |
|
|
'proxy' => 'bar', |
|
|
'headers' => [ |
|
|
|
|
|
'User-Agent' => 'Nextcloud Server Crawler' |
|
|
|
|
|
] |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
$this->guzzleClient->method('request') |
|
|
$this->guzzleClient->method('request') |
|
|
->with('get', 'http://localhost/', $options) |
|
|
->with('get', 'http://localhost/', $options) |
|
|
|
|
|
|
|
|
public function testPostWithOptions(): void { |
|
|
public function testPostWithOptions(): void { |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
|
|
|
|
|
|
$options = [ |
|
|
|
|
|
|
|
|
$options = array_merge($this->defaultRequestOptions, [ |
|
|
'verify' => false, |
|
|
'verify' => false, |
|
|
'proxy' => 'bar', |
|
|
'proxy' => 'bar', |
|
|
'headers' => [ |
|
|
|
|
|
'User-Agent' => 'Nextcloud Server Crawler' |
|
|
|
|
|
] |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
$this->guzzleClient->method('request') |
|
|
$this->guzzleClient->method('request') |
|
|
->with('post', 'http://localhost/', $options) |
|
|
->with('post', 'http://localhost/', $options) |
|
|
|
|
|
|
|
|
public function testPutWithOptions(): void { |
|
|
public function testPutWithOptions(): void { |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
|
|
|
|
|
|
$options = [ |
|
|
|
|
|
|
|
|
$options = array_merge($this->defaultRequestOptions, [ |
|
|
'verify' => false, |
|
|
'verify' => false, |
|
|
'proxy' => 'bar', |
|
|
'proxy' => 'bar', |
|
|
'headers' => [ |
|
|
|
|
|
'User-Agent' => 'Nextcloud Server Crawler' |
|
|
|
|
|
] |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
$this->guzzleClient->method('request') |
|
|
$this->guzzleClient->method('request') |
|
|
->with('put', 'http://localhost/', $options) |
|
|
->with('put', 'http://localhost/', $options) |
|
|
|
|
|
|
|
|
public function testDeleteWithOptions(): void { |
|
|
public function testDeleteWithOptions(): void { |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
|
|
|
|
|
|
$options = [ |
|
|
|
|
|
|
|
|
$options = array_merge($this->defaultRequestOptions, [ |
|
|
'verify' => false, |
|
|
'verify' => false, |
|
|
'proxy' => 'bar', |
|
|
'proxy' => 'bar', |
|
|
'headers' => [ |
|
|
|
|
|
'User-Agent' => 'Nextcloud Server Crawler' |
|
|
|
|
|
] |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
$this->guzzleClient->method('request') |
|
|
$this->guzzleClient->method('request') |
|
|
->with('delete', 'http://localhost/', $options) |
|
|
->with('delete', 'http://localhost/', $options) |
|
|
|
|
|
|
|
|
public function testOptionsWithOptions(): void { |
|
|
public function testOptionsWithOptions(): void { |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
|
|
|
|
|
|
$options = [ |
|
|
|
|
|
|
|
|
$options = array_merge($this->defaultRequestOptions, [ |
|
|
'verify' => false, |
|
|
'verify' => false, |
|
|
'proxy' => 'bar', |
|
|
'proxy' => 'bar', |
|
|
'headers' => [ |
|
|
|
|
|
'User-Agent' => 'Nextcloud Server Crawler' |
|
|
|
|
|
] |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
$this->guzzleClient->method('request') |
|
|
$this->guzzleClient->method('request') |
|
|
->with('options', 'http://localhost/', $options) |
|
|
->with('options', 'http://localhost/', $options) |
|
|
|
|
|
|
|
|
public function testHeadWithOptions(): void { |
|
|
public function testHeadWithOptions(): void { |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
$this->setUpDefaultRequestOptions(); |
|
|
|
|
|
|
|
|
$options = [ |
|
|
|
|
|
|
|
|
$options = array_merge($this->defaultRequestOptions, [ |
|
|
'verify' => false, |
|
|
'verify' => false, |
|
|
'proxy' => 'bar', |
|
|
'proxy' => 'bar', |
|
|
'headers' => [ |
|
|
|
|
|
'User-Agent' => 'Nextcloud Server Crawler' |
|
|
|
|
|
] |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
$this->guzzleClient->method('request') |
|
|
$this->guzzleClient->method('request') |
|
|
->with('head', 'http://localhost/', $options) |
|
|
->with('head', 'http://localhost/', $options) |
|
|
|
|
|
|
|
|
'proxy' => null, |
|
|
'proxy' => null, |
|
|
'headers' => [ |
|
|
'headers' => [ |
|
|
'User-Agent' => 'Nextcloud Server Crawler' |
|
|
'User-Agent' => 'Nextcloud Server Crawler' |
|
|
] |
|
|
|
|
|
|
|
|
], |
|
|
|
|
|
'timeout' => 30, |
|
|
], self::invokePrivate($this->client, 'buildRequestOptions', [[]])); |
|
|
], self::invokePrivate($this->client, 'buildRequestOptions', [[]])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'proxy' => 'foo', |
|
|
'proxy' => 'foo', |
|
|
'headers' => [ |
|
|
'headers' => [ |
|
|
'User-Agent' => 'Nextcloud Server Crawler' |
|
|
'User-Agent' => 'Nextcloud Server Crawler' |
|
|
] |
|
|
|
|
|
|
|
|
], |
|
|
|
|
|
'timeout' => 30, |
|
|
], self::invokePrivate($this->client, 'buildRequestOptions', [[]])); |
|
|
], self::invokePrivate($this->client, 'buildRequestOptions', [[]])); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |