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

Some small bugfixes for namespacing

parent 9c4aecf5
...@@ -67,7 +67,7 @@ class ZendHttp extends Adapter ...@@ -67,7 +67,7 @@ class ZendHttp extends Adapter
* Set options * Set options
* *
* Overrides any existing values. * Overrides any existing values.
* *
* If the options array has an 'options' entry it is forwarded to the * 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 * Zend_Http_Client. See the Zend_Http_Clientdocs for the many config
* options available. * options available.
...@@ -93,7 +93,7 @@ class ZendHttp extends Adapter ...@@ -93,7 +93,7 @@ class ZendHttp extends Adapter
if (isset($this->_options['options'])) { if (isset($this->_options['options'])) {
$adapterOptions = array_merge($adapterOptions, $this->_options['options']); $adapterOptions = array_merge($adapterOptions, $this->_options['options']);
} }
$this->_zendHttp->setConfig($adapterOptions); $this->_zendHttp->setConfig($adapterOptions);
} }
...@@ -141,7 +141,7 @@ class ZendHttp extends Adapter ...@@ -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; return $this->_zendHttp;
......
...@@ -487,7 +487,7 @@ class Loadbalancer extends Solarium\Plugin\AbstractPlugin ...@@ -487,7 +487,7 @@ class Loadbalancer extends Solarium\Plugin\AbstractPlugin
$adapter->setOptions($options); $adapter->setOptions($options);
try { try {
return $adapter->execute($request); return $adapter->execute($request);
} catch(olarium\Client\HttpException $e) { } catch(\Solarium\Client\HttpException $e) {
// ignore HTTP errors and try again // ignore HTTP errors and try again
// but do issue an event for things like logging // but do issue an event for things like logging
$e = new \Solarium\Exception('Maximum number of loadbalancer retries reached'); $e = new \Solarium\Exception('Maximum number of loadbalancer retries reached');
......
...@@ -40,11 +40,11 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase ...@@ -40,11 +40,11 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase
public function setUp() 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'); $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(); $this->_adapter = new \Solarium\Client\Adapter\ZendHttp();
} }
...@@ -53,7 +53,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase ...@@ -53,7 +53,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase
{ {
$options = array('timeout' => 10, 'optionZ' => 123, 'options' => array('optionX' => 'Y')); $options = array('timeout' => 10, 'optionZ' => 123, 'options' => array('optionX' => 'Y'));
$adapterOptions = array('timeout' => 10, 'optionX' => 'Y'); $adapterOptions = array('timeout' => 10, 'optionX' => 'Y');
$mock = $this->getMock('Zend_Http_Client'); $mock = $this->getMock('Zend_Http_Client');
$mock->expects($this->once()) $mock->expects($this->once())
->method('setConfig') ->method('setConfig')
...@@ -100,7 +100,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase ...@@ -100,7 +100,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase
$request->setHeaders($headers); $request->setHeaders($headers);
$request->setRawData($rawData); $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 = $this->getMock('Zend_Http_Client');
$mock->expects($this->once()) $mock->expects($this->once())
...@@ -131,7 +131,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase ...@@ -131,7 +131,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase
public function testExecuteErrorResponse() public function testExecuteErrorResponse()
{ {
$request = new \Solarium\Client\Request(); $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 = $this->getMock('Zend_Http_Client');
$mock->expects($this->once()) $mock->expects($this->once())
...@@ -149,7 +149,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase ...@@ -149,7 +149,7 @@ class ZendHttpTest extends \PHPUnit_Framework_TestCase
{ {
$request = new \Solarium\Client\Request(); $request = new \Solarium\Client\Request();
$request->setMethod(\Solarium\Client\Request::METHOD_HEAD); $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 = $this->getMock('Zend_Http_Client');
$mock->expects($this->once()) $mock->expects($this->once())
......
...@@ -425,7 +425,7 @@ class LoadbalancerTest extends \PHPUnit_Framework_TestCase ...@@ -425,7 +425,7 @@ class LoadbalancerTest extends \PHPUnit_Framework_TestCase
$query = new \Solarium\Query\Select\Select(); $query = new \Solarium\Query\Select\Select();
$this->_plugin->preCreateRequest($query); $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); $this->_plugin->preExecuteRequest($request);
} }
......
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