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
d4d51869
Commit
d4d51869
authored
Oct 14, 2014
by
Olivier Lequeux
Browse files
fix all tests suite
parent
da78a05f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
src/Lavoisier/Entries/Entries.php
src/Lavoisier/Entries/Entries.php
+2
-8
tests/EntriesHydratorTest.php
tests/EntriesHydratorTest.php
+0
-1
tests/EntriesTest.php
tests/EntriesTest.php
+7
-1
No files found.
src/Lavoisier/Entries/Entries.php
View file @
d4d51869
...
...
@@ -30,12 +30,6 @@ class Entries extends \ArrayObject implements IEntries
}
}
public
function
__construct
()
{
$this
->
useLavoisierXMLNS
=
true
;
}
public
function
init
()
{
}
...
...
@@ -79,9 +73,9 @@ class Entries extends \ArrayObject implements IEntries
static
protected
function
convertToEntries
(
$data
,
$useLavoisierXMLNS
=
true
)
{
$xml
=
sprintf
(
'<e:entries xmlns:e="%s">'
,
self
::
getXMLNS
(
$useLavoisierXMLNS
));
$xml
=
sprintf
(
'<e:entries xmlns:e="%s">'
,
self
::
getXMLNS
(
$useLavoisierXMLNS
));
foreach
(
$data
as
$key
=>
$entry
)
{
if
(
is_array
(
$entry
))
{
if
(
is_array
(
$entry
))
{
$xml
.
=
self
::
convertToEntries
(
$entry
);
}
else
{
$xml
.
=
'<e:entry key ="'
.
$key
.
'">'
.
$entry
.
'</e:entry>'
;
...
...
tests/EntriesHydratorTest.php
View file @
d4d51869
...
...
@@ -2,7 +2,6 @@
namespace
Lavoisier\Hydrators
;
use
Lavoisier\Hydrators\EntriesHydrator
;
class
EntriesHydratorTest
extends
\
PHPUnit_Framework_TestCase
...
...
tests/EntriesTest.php
View file @
d4d51869
...
...
@@ -29,7 +29,6 @@ class EntriesTest extends \PHPUnit_Framework_TestCase
$ouput_obtained
=
$lh
->
asXmlEntries
();
$this
->
assertXmlStringEqualsXmlString
(
$output_expected
,
$ouput_obtained
);
}
...
...
@@ -44,4 +43,11 @@ class EntriesTest extends \PHPUnit_Framework_TestCase
}
public
function
getXMLNStest
()
{
$this
->
assertEquals
(
"http://software.in2p3.fr/lavoisier/entries.xsd"
,
Entries
::
getXMLNS
());
$this
->
assertEquals
(
"https://gitlab.in2p3.fr/opsportal/lavoisiercli/raw/master/resources/ex_entries.xsd"
,
Entries
::
getXMLNS
(
true
));
}
}
\ 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