_quoteXMLChars() public method

Quotes special XML characters.
public _quoteXMLChars ( $string ) : string
return string quoted string
Beispiel #1
0
 /**
  * Should convert specials chars, & encode in utf8.
  */
 public function testQuoteXMLChars()
 {
     $ops = new Ops();
     $data = 'This is my & < > \' " string';
     $result = $ops->_quoteXMLChars($data);
     /// chars should be converted
     $this->assertEquals($result, 'This is my &amp; &lt; &gt; &apos; &quot; string');
     // should be utf8
     $this->assertTrue(mb_check_encoding($result, 'UTF-8'));
 }