Sets the options to be used in subsequent curl requests.
public set ( array $flags, array $value = null ) : void | ||
$flags | array | If $values is an array, $flags will be used as the keys to an associative array of curl options. If $values is not set, then $flags will be used as the associative array. |
$value | array | If set, this array becomes the values for the associative array of curl options. |
return | void |
public function testWriteAndRead() { $stream = new Curl($this->_testConfig); $this->assertTrue(is_resource($stream->open())); $this->assertTrue(is_resource($stream->resource())); $stream->set(CURLOPT_URL, $this->_testUrl); $this->assertTrue($stream->write(null)); $this->assertTrue($stream->read()); $response = $stream->send(new Request(), array('response' => 'lithium\\net\\http\\Response')); $this->assertEqual(trim(file_get_contents($this->_testUrl)), trim($response->body())); $this->assertNull($stream->eof()); }
public function testSettingOfOptions() { $stream = new Curl($this->_testConfig); $stream->set('DummyFlag', 'Dummy Value'); $stream->set('DummyFlag', 'Changed Dummy Value'); $this->assertEqual('Changed Dummy Value', $stream->options['DummyFlag']); }