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
cfc8f6cc
Commit
cfc8f6cc
authored
Dec 19, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some small bugfixes for namespacing
parent
9c4aecf5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
library/Solarium/Client/Adapter/ZendHttp.php
library/Solarium/Client/Adapter/ZendHttp.php
+3
-3
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
+1
-1
tests/Solarium/Tests/Client/Adapter/ZendHttpTest.php
tests/Solarium/Tests/Client/Adapter/ZendHttpTest.php
+6
-6
tests/Solarium/Tests/Plugin/LoadbalancerTest.php
tests/Solarium/Tests/Plugin/LoadbalancerTest.php
+1
-1
No files found.
library/Solarium/Client/Adapter/ZendHttp.php
View file @
cfc8f6cc
...
...
@@ -67,7 +67,7 @@ class ZendHttp extends Adapter
* Set options
*
* Overrides any existing values.
*
*
* If the options array has an 'options' entry it is forwarded to the
* Zend_Http_Client. See the Zend_Http_Clientdocs for the many config
* options available.
...
...
@@ -93,7 +93,7 @@ class ZendHttp extends Adapter
if
(
isset
(
$this
->
_options
[
'options'
]))
{
$adapterOptions
=
array_merge
(
$adapterOptions
,
$this
->
_options
[
'options'
]);
}
$this
->
_zendHttp
->
setConfig
(
$adapterOptions
);
}
...
...
@@ -141,7 +141,7 @@ class ZendHttp extends Adapter
);
}
$this
->
_zendHttp
=
new
\Zend
\Http\
Client
(
null
,
$options
);
$this
->
_zendHttp
=
new
\Zend
_Http_
Client
(
null
,
$options
);
}
return
$this
->
_zendHttp
;
...
...
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
View file @
cfc8f6cc
...
...
@@ -487,7 +487,7 @@ class Loadbalancer extends Solarium\Plugin\AbstractPlugin
$adapter
->
setOptions
(
$options
);
try
{
return
$adapter
->
execute
(
$request
);
}
catch
(
olarium\Client\HttpException
$e
)
{
}
catch
(
\S
olarium\Client\HttpException
$e
)
{
// ignore HTTP errors and try again
// but do issue an event for things like logging
$e
=
new
\Solarium\Exception
(
'Maximum number of loadbalancer retries reached'
);
...
...
tests/Solarium/Tests/Client/Adapter/ZendHttpTest.php
View file @
cfc8f6cc
...
...
@@ -40,11 +40,11 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase
public
function
setUp
()
{
if
(
!
class_exists
(
'Zend_Loader_Autoloader'
)
&&
(
@
include_once
'Zend/Loader/Autoloader.php'
)
!==
'OK'
)
{
if
(
!
class_exists
(
'Zend_Loader_Autoloader'
)
&&
!
(
@
include_once
'Zend/Loader/Autoloader.php'
)
)
{
$this
->
markTestSkipped
(
'ZF not in include_path, skipping ZendHttp adapter tests'
);
}
Zend_Loader_Autoloader
::
getInstance
();
\
Zend_Loader_Autoloader
::
getInstance
();
$this
->
_adapter
=
new
\Solarium\Client\Adapter\ZendHttp
();
}
...
...
@@ -53,7 +53,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase
{
$options
=
array
(
'timeout'
=>
10
,
'optionZ'
=>
123
,
'options'
=>
array
(
'optionX'
=>
'Y'
));
$adapterOptions
=
array
(
'timeout'
=>
10
,
'optionX'
=>
'Y'
);
$mock
=
$this
->
getMock
(
'Zend_Http_Client'
);
$mock
->
expects
(
$this
->
once
())
->
method
(
'setConfig'
)
...
...
@@ -100,7 +100,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase
$request
->
setHeaders
(
$headers
);
$request
->
setRawData
(
$rawData
);
$response
=
new
Zend_Http_Response
(
200
,
array
(
'status'
=>
'HTTP 1.1 200 OK'
),
$responseData
);
$response
=
new
\
Zend_Http_Response
(
200
,
array
(
'status'
=>
'HTTP 1.1 200 OK'
),
$responseData
);
$mock
=
$this
->
getMock
(
'Zend_Http_Client'
);
$mock
->
expects
(
$this
->
once
())
...
...
@@ -131,7 +131,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase
public
function
testExecuteErrorResponse
()
{
$request
=
new
\Solarium\Client\Request
();
$response
=
new
Zend_Http_Response
(
404
,
array
(),
''
);
$response
=
new
\
Zend_Http_Response
(
404
,
array
(),
''
);
$mock
=
$this
->
getMock
(
'Zend_Http_Client'
);
$mock
->
expects
(
$this
->
once
())
...
...
@@ -149,7 +149,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase
{
$request
=
new
\Solarium\Client\Request
();
$request
->
setMethod
(
\Solarium\Client\Request
::
METHOD_HEAD
);
$response
=
new
Zend_Http_Response
(
200
,
array
(
'status'
=>
'HTTP 1.1 200 OK'
),
'data'
);
$response
=
new
\
Zend_Http_Response
(
200
,
array
(
'status'
=>
'HTTP 1.1 200 OK'
),
'data'
);
$mock
=
$this
->
getMock
(
'Zend_Http_Client'
);
$mock
->
expects
(
$this
->
once
())
...
...
tests/Solarium/Tests/Plugin/LoadbalancerTest.php
View file @
cfc8f6cc
...
...
@@ -425,7 +425,7 @@ class LoadbalancerTest extends \PHPUnit_Framework_TestCase
$query
=
new
\Solarium\Query\Select\Select
();
$this
->
_plugin
->
preCreateRequest
(
$query
);
$this
->
setExpectedException
(
'Solarium\Exception'
,
'Maximum number of loadbalancer retries reached'
);
$this
->
setExpectedException
(
'
\
Solarium\Exception'
,
'Maximum number of loadbalancer retries reached'
);
$this
->
_plugin
->
preExecuteRequest
(
$request
);
}
...
...
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