another test for xmlify

Alexander Kampmann 2012-03-15 10:51:22 +01:00
parent 70709a8825
commit 29ade1d9b9
1 changed files with 22 additions and 1 deletions

View File

@ -27,11 +27,32 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase {
public function testXmlify() {
$text="<tag>I want to break\n this!11!<?hard?></tag>";
$xml=xmlify($text); //test whether it actually may be part of a xml document
$this->assertEquals($text, $retext);
* xmlify and put in a document
public function testXmlifyDocument() {
$tag="<tag>I want to break</tag>";
//should be possible to parse it
$values=array(); $index=array();
$this->assertEquals(1, xml_parse_into_struct($xml_parser, $text, $values, $index));
$this->assertEquals(array(array('tag'=>'TEXT', 'type'=>'complete', 'level'=>1, 'value'=>$tag)),
* test hex2bin and reverse