Пример #1
0
 public function test_process_raw_options()
 {
     $client = new HttpClient();
     $url = new Url('http://google.com');
     $request = new HttpRequest(HttpRequestMethod::GET, $url);
     $response = $client->send($request);
     $this->assertTrue($response->isRedirect());
     $client->getOptions()->set('CURLOPT_FOLLOWLOCATION', true);
     $response = $client->send($request);
     $this->assertTrue($response->isOk());
 }
Пример #2
0
 public function test_create_client_with_options()
 {
     $options = new HttpClientOptions();
     $client = new HttpClient(null, $options);
     $this->assertTrue($client->getOptions() === $options);
 }