OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
php84
/
usr
/
share
/
pear
/
test
/
XML_Util
/
tests
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
π
..
-
01/29/2025 12:55:23 PM
rwxr-xr-x
π
AbstractUnitTests.php
424 bytes
12/17/2024 06:12:51 PM
rw-r--r--
π
ApiVersionTests.php
221 bytes
12/17/2024 06:12:51 PM
rw-r--r--
π
AttributesToStringTests.php
7.52 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
Bug18343Tests.php
1.7 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
Bug21177Tests.php
1.03 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
Bug21184Tests.php
450 bytes
12/17/2024 06:12:51 PM
rw-r--r--
π
Bug4950Tests.php
729 bytes
12/17/2024 06:12:51 PM
rw-r--r--
π
Bug5392Tests.php
767 bytes
12/17/2024 06:12:51 PM
rw-r--r--
π
CollapseEmptyTagsTests.php
4.25 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
CreateCDataSectionTests.php
362 bytes
12/17/2024 06:12:51 PM
rw-r--r--
π
CreateCommentTests.php
340 bytes
12/17/2024 06:12:51 PM
rw-r--r--
π
CreateEndElementTests.php
613 bytes
12/17/2024 06:12:51 PM
rw-r--r--
π
CreateStartElementTests.php
5.28 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
CreateTagFromArrayTests.php
13.18 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
CreateTagTests.php
7.79 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
GetDocTypeDeclarationTests.php
1.74 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
GetXmlDeclarationTests.php
1.14 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
IsValidNameTests.php
1.94 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
RaiseErrorTests.php
448 bytes
12/17/2024 06:12:51 PM
rw-r--r--
π
ReplaceEntitiesTests.php
4.22 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
ReverseEntitiesTests.php
4.21 KB
12/17/2024 06:12:51 PM
rw-r--r--
π
SplitQualifiedNameTests.php
839 bytes
12/17/2024 06:12:51 PM
rw-r--r--
Editing: ReverseEntitiesTests.php
Close
<?php class ReverseEntitiesTests extends AbstractUnitTests { protected function getSimpleData() { return 'This string contains < & >.'; } protected function getUtf8Data() { return 'This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê'; } /** * @covers XML_Util::reverseEntities() */ public function testReverseEntitiesForSimpleData() { $expected = "This string contains < & >."; $this->assertEquals($expected, XML_Util::reverseEntities($this->getSimpleData())); } /** * @covers XML_Util::reverseEntities() */ public function testReverseEntitiesForSimpleDataWithInvalidOptionReturnsOriginalData() { $expected = "This string contains < & >."; $this->assertEquals($expected, XML_Util::reverseEntities($this->getSimpleData(), 'INVALID_OPTION')); } /** * @covers XML_Util::reverseEntities() */ public function testReverseEntitiesForSimpleDataWithEntitiesXml() { $expected = "This string contains < & >."; $this->assertEquals($expected, XML_Util::reverseEntities($this->getSimpleData(), XML_UTIL_ENTITIES_XML)); } /** * @covers XML_Util::reverseEntities() */ public function testReverseEntitiesForSimpleDataWithEntitiesXmlAndEncoding() { $encoding = "UTF-8"; $expected = "This string contains < & >."; $this->assertEquals($expected, XML_Util::reverseEntities($this->getSimpleData(), XML_UTIL_ENTITIES_XML), $encoding); } /** * @covers XML_Util::reverseEntities() */ public function testReverseEntitiesForUtf8DataWithEntitiesXmlAndEncoding() { $encoding = "UTF-8"; $expected = "This data contains special chars like <, >, & and \" as well as ä, ö, ß, à and ê"; $this->assertEquals($expected, XML_Util::reverseEntities($this->getUtf8Data(), XML_UTIL_ENTITIES_XML), $encoding); } /** * @covers XML_Util::reverseEntities() */ public function testReverseEntitiesForSimpleDataWithEntitiesXmlRequired() { $expected = "This string contains < & >."; $this->assertEquals($expected, XML_Util::reverseEntities($this->getSimpleData(), XML_UTIL_ENTITIES_XML_REQUIRED)); } /** * @covers XML_Util::reverseEntities() */ public function testReverseEntitiesForSimpleDataWithEntitiesXmlRequiredAndEncoding() { $encoding = "UTF-8"; $expected = "This string contains < & >."; $this->assertEquals($expected, XML_Util::reverseEntities($this->getSimpleData(), XML_UTIL_ENTITIES_XML_REQUIRED, $encoding)); } /** * @covers XML_Util::reverseEntities() */ public function testReverseEntitiesForUtf8DataWithEntitiesXmlRequiredAndEncoding() { $encoding = "UTF-8"; $expected = "This data contains special chars like <, >, & and \" as well as ä, ö, ß, à and ê"; $this->assertEquals($expected, XML_Util::reverseEntities($this->getUtf8Data(), XML_UTIL_ENTITIES_XML_REQUIRED, $encoding)); } /** * @covers XML_Util::reverseEntities() */ public function testReverseEntitiesForSimpleDataWithEntitiesHtml() { $expected = "This string contains < & >."; $this->assertEquals($expected, XML_Util::reverseEntities($this->getSimpleData(), XML_UTIL_ENTITIES_HTML)); } /** * @covers XML_Util::reverseEntities() */ public function testReverseEntitiesForSimpleDataWithEntitiesHtmlAndEncoding() { $encoding = "UTF-8"; $expected = "This string contains < & >."; $this->assertEquals($expected, XML_Util::reverseEntities($this->getSimpleData(), XML_UTIL_ENTITIES_HTML, $encoding)); } /** * @covers XML_Util::reverseEntities() */ public function testReverseEntitiesForUtf8DataWithEntitiesHtmlAndEncoding() { $encoding = "UTF-8"; $expected = "This data contains special chars like <, >, & and \" as well as Γ€, ΓΆ, Γ, Γ and Γͺ"; $this->assertEquals($expected, XML_Util::reverseEntities($this->getUtf8Data(), XML_UTIL_ENTITIES_HTML, $encoding)); } }