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
88c34f1f
Commit
88c34f1f
authored
Oct 15, 2014
by
Olivier Lequeux
Browse files
add simpleXMLHydrator test
parent
d4d51869
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
src/Lavoisier/Hydrators/SimpleXMLHydrator.php
src/Lavoisier/Hydrators/SimpleXMLHydrator.php
+1
-1
tests/EntriesHydratorTest.php
tests/EntriesHydratorTest.php
+0
-1
tests/SimpleXMLHydratorTest.php
tests/SimpleXMLHydratorTest.php
+29
-0
No files found.
src/Lavoisier/Hydrators/SimpleXMLHydrator.php
View file @
88c34f1f
...
...
@@ -2,7 +2,7 @@
namespace
Lavoisier\Hydrators
;
use
\
Lavoisier\IHydrator
;
use
\
Lavoisier\
Hydrators\
IHydrator
;
class
SimpleXMLHydrator
implements
IHydrator
{
...
...
tests/EntriesHydratorTest.php
View file @
88c34f1f
...
...
@@ -3,7 +3,6 @@
namespace
Lavoisier\Hydrators
;
class
EntriesHydratorTest
extends
\
PHPUnit_Framework_TestCase
{
public
function
testHydrate
()
...
...
tests/SimpleXMLHydratorTest.php
0 → 100644
View file @
88c34f1f
<?php
/**
* Created by PhpStorm.
* User: olequeux
* Date: 14/10/14
* Time: 19:26
*/
class
SimpleXMLHydratorTest
extends
PHPUnit_Framework_TestCase
{
public
function
testGlobal
()
{
$input
=
<<<EOF
<root>
<child1 foo="bar">1st child text node</child1>
<child2 foo="bar">2nd child text node</child2>
</root>
EOF;
$lh
=
new
\
Lavoisier\Hydrators\SimpleXMLHydrator
();
$simpleXMLObj
=
$lh
->
hydrate
(
$input
);
$this
->
assertEquals
(
$simpleXMLObj
->
child1
,
'1st child text node'
);
}
}
\ No newline at end of file
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