Commit e0c51c45 authored by Olivier Lequeux's avatar Olivier Lequeux
Browse files

fix IHydrators namespace in SimpleXMLHydrator

parent 982d58a0
......@@ -11,6 +11,7 @@ namespace Lavoisier;
use \Lavoisier\Hydrators\DefaultHydrator;
use \Lavoisier\Exceptions\HTTPStatusException;
use \Lavoisier\Exceptions\cURLException;
use \Lavoisier\Hydrators\IHydrator;
class Query
{
......
......@@ -10,6 +10,25 @@ use \Lavoisier\Query;
class QueryTest extends \PHPUnit_Framework_TestCase
{
public function testUseHydrators() {
// SimpleXML
$stubQuery = $this->getMock('Lavoisier\Query', array('curl'), array('localhost'));
$stubQuery->expects($this->any())
->method('curl')
->will($this->returnValue(array('content'=>
file_get_contents(dirname(__FILE__) . "/Resources/tickets.xml"))));
$hydrator = new \Lavoisier\Hydrators\SimpleXMLHydrator();
$hydrator->registerEntriesNamespace(false);
$stubQuery->setHydrator($hydrator);
$result = $stubQuery->execute();
$this->assertEquals(50455, strval($result->entries[0]->entry[0]));
}
public function testQuery()
{
$xlq = new Query('localhost', 'myView');
......
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