Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
c574e8c0
Commit
c574e8c0
authored
Feb 06, 2012
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for PHP warnings when running unittests without pecl_http available
parent
630ee35d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
29 deletions
+32
-29
tests/Solarium/Client/Adapter/PeclHttpTest.php
tests/Solarium/Client/Adapter/PeclHttpTest.php
+32
-29
No files found.
tests/Solarium/Client/Adapter/PeclHttpTest.php
View file @
c574e8c0
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment