Example #1
0
 /**
  * @group ZF-8053
  */
 public function testGetAndSetUserAgentOption()
 {
     $client = new Client();
     $this->assertNull($client->getUserAgent());
     $client->setUserAgent('agent1');
     $this->assertEquals('agent1', $client->getUserAgent());
     $client->setOptions(array('user_agent' => 'agent2'));
     $this->assertEquals('agent2', $client->getUserAgent());
     $client->setOptions(array('useragent' => 'agent3'));
     $this->assertEquals('agent3', $client->getUserAgent());
     $client->setOptions(array('userAgent' => 'agent4'));
     $this->assertEquals('agent4', $client->getUserAgent());
     $options = $client->getOptions();
     $this->assertEquals('agent4', $options['user_agent']);
 }
Example #2
0
 /**
  * Sets options.
  *
  * Allows setting options as an associative array of option => value pairs.
  *
  * @param  array|\Traversable $options Options.
  * @throws \InvalidArgumentException If an unsupported option is passed.
  * @return self
  */
 public function setOptions($options)
 {
     if (isset($options['authentication']) && $options['authentication'] === 'ntlm') {
         $this->useNtlm = true;
         unset($options['authentication']);
     }
     $this->options = $options;
     return parent::setOptions($options);
 }