Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1821582
CDataTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
CDataTest.php
View Options
<?php
namespace
Sabre\Xml\Element
;
use
Sabre\Xml\Reader
;
use
Sabre\Xml\Writer
;
class
CDataTest
extends
\PHPUnit_Framework_TestCase
{
/**
* @expectedException \LogicException
*/
function
testDeserialize
()
{
$input
=
<<<BLA
<?xml version="1.0"?>
<root xmlns="http://sabredav.org/ns">
<blabla />
</root>
BLA;
$reader
=
new
Reader
();
$reader
->
elementMap
=
[
'{http://sabredav.org/ns}blabla'
=>
'Sabre
\\
Xml
\\
Element
\\
Cdata'
,
];
$reader
->
xml
(
$input
);
$output
=
$reader
->
parse
();
}
function
testSerialize
()
{
$writer
=
new
Writer
();
$writer
->
namespaceMap
=
[
'http://sabredav.org/ns'
=>
null
];
$writer
->
openMemory
();
$writer
->
startDocument
(
'1.0'
);
$writer
->
setIndent
(
true
);
$writer
->
write
([
'{http://sabredav.org/ns}root'
=>
new
Cdata
(
'<foo&bar>'
),
]);
$output
=
$writer
->
outputMemory
();
$expected
=
<<<XML
<?xml version="1.0"?>
<root xmlns="http://sabredav.org/ns"><![CDATA[<foo&bar>]]></root>
XML;
$this
->
assertEquals
(
$expected
,
$output
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Dec 24, 5:08 AM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
917306
Default Alt Text
CDataTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment