X7ROOT File Manager
Current Path:
/opt/alt/php81/usr/share/pear/test/XML_Util/tests
opt
/
alt
/
php81
/
usr
/
share
/
pear
/
test
/
XML_Util
/
tests
/
π
..
π
AbstractUnitTests.php
(424 B)
π
ApiVersionTests.php
(221 B)
π
AttributesToStringTests.php
(7.52 KB)
π
Bug18343Tests.php
(1.7 KB)
π
Bug21177Tests.php
(1.03 KB)
π
Bug21184Tests.php
(450 B)
π
Bug4950Tests.php
(729 B)
π
Bug5392Tests.php
(767 B)
π
CollapseEmptyTagsTests.php
(4.25 KB)
π
CreateCDataSectionTests.php
(362 B)
π
CreateCommentTests.php
(340 B)
π
CreateEndElementTests.php
(613 B)
π
CreateStartElementTests.php
(5.28 KB)
π
CreateTagFromArrayTests.php
(13.18 KB)
π
CreateTagTests.php
(7.79 KB)
π
GetDocTypeDeclarationTests.php
(1.74 KB)
π
GetXmlDeclarationTests.php
(1.14 KB)
π
IsValidNameTests.php
(1.94 KB)
π
RaiseErrorTests.php
(448 B)
π
ReplaceEntitiesTests.php
(4.22 KB)
π
ReverseEntitiesTests.php
(4.21 KB)
π
SplitQualifiedNameTests.php
(839 B)
Editing: ReverseEntitiesTests.php
<?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)); } }
Upload File
Create Folder