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 set($flags, $value = null)
{
if ($value !== null) {
$flags = array($flags => $value);
}
$this->options = $flags + $this->options;
}
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()); }