Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
OpsPortal
lavoisiercli
Commits
e0c51c45
Commit
e0c51c45
authored
Oct 15, 2014
by
Olivier Lequeux
Browse files
fix IHydrators namespace in SimpleXMLHydrator
parent
982d58a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
src/Lavoisier/Query.php
src/Lavoisier/Query.php
+1
-0
tests/QueryTest.php
tests/QueryTest.php
+19
-0
No files found.
src/Lavoisier/Query.php
View file @
e0c51c45
...
...
@@ -11,6 +11,7 @@ namespace Lavoisier;
use
\
Lavoisier\Hydrators\DefaultHydrator
;
use
\
Lavoisier\Exceptions\HTTPStatusException
;
use
\
Lavoisier\Exceptions\cURLException
;
use
\
Lavoisier\Hydrators\IHydrator
;
class
Query
{
...
...
tests/QueryTest.php
View file @
e0c51c45
...
...
@@ -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'
);
...
...
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