-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathXML2ArrayTest.php
More file actions
41 lines (36 loc) · 828 Bytes
/
XML2ArrayTest.php
File metadata and controls
41 lines (36 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace LSS_tests;
/**
* @internal
*/
final class XML2ArrayTest extends \PHPUnit\Framework\TestCase
{
public function testCreateArray() {
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<news>
<title>A title</title>
<body>
<html>
<body>
<p>The content for the news item</p>
</body>
</html>
</body>
</news>
';
$array = \LSS\XML2Array::createArray($xml);
$expected = array(
'news' => array(
'title' => 'A title',
'body' => array(
'html' => array(
'body' => array(
'p' => 'The content for the news item',
),
),
),
),
);
static::assertSame($expected, $array);
}
}