Commit c574e8c0 authored by Bas de Nooijer's avatar Bas de Nooijer

Fix for PHP warnings when running unittests without pecl_http available

parent 630ee35d
......@@ -62,36 +62,39 @@ class Solarium_Client_Adapter_PeclHttpTest extends PHPUnit_Framework_TestCase
public function requestProvider()
{
$methods = array(
Solarium_Client_Request::METHOD_GET => array(
'method' => HTTP_METH_GET,
'support' => true
),
Solarium_Client_Request::METHOD_POST => array(
'method' => HTTP_METH_POST,
'support' => true
),
Solarium_Client_Request::METHOD_HEAD => array(
'method' => HTTP_METH_HEAD,
'support' => true
),
'PUT' => array(
'method' => HTTP_METH_PUT,
'support' => false
),
'DELETE' => array(
'method' => HTTP_METH_DELETE,
'support' => false
),
);
foreach ($methods as $method => $options) {
$request = new Solarium_Client_Request;
$request->setMethod($method);
$data[] = array_merge(array($request), $options);
}
// prevents undefined constants errors
if (function_exists('http_get')) {
$methods = array(
Solarium_Client_Request::METHOD_GET => array(
'method' => HTTP_METH_GET,
'support' => true
),
Solarium_Client_Request::METHOD_POST => array(
'method' => HTTP_METH_POST,
'support' => true
),
Solarium_Client_Request::METHOD_HEAD => array(
'method' => HTTP_METH_HEAD,
'support' => true
),
'PUT' => array(
'method' => HTTP_METH_PUT,
'support' => false
),
'DELETE' => array(
'method' => HTTP_METH_DELETE,
'support' => false
),
);
foreach ($methods as $method => $options) {
$request = new Solarium_Client_Request;
$request->setMethod($method);
$data[] = array_merge(array($request), $options);
}
return $data;
return $data;
}
}
public function testToHttpRequestWithHeaders()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment