You are here

public static function PHPUnit_Util_XML::prepareString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Util/XML.php \PHPUnit_Util_XML::prepareString()

Escapes a string for the use in XML documents Any Unicode character is allowed, excluding the surrogate blocks, FFFE, and FFFF (not even as character reference). See http://www.w3.org/TR/xml/#charsets

@since Method available since Release 3.4.6

Parameters

string $string:

Return value

string

6 calls to PHPUnit_Util_XML::prepareString()
PHPUnit_Util_Log_JUnit::addError in vendor/phpunit/phpunit/src/Util/Log/JUnit.php
An error occurred.
PHPUnit_Util_Log_JUnit::addFailure in vendor/phpunit/phpunit/src/Util/Log/JUnit.php
A failure occurred.
PHPUnit_Util_Log_JUnit::addIncompleteTest in vendor/phpunit/phpunit/src/Util/Log/JUnit.php
Incomplete test.
PHPUnit_Util_Log_JUnit::addRiskyTest in vendor/phpunit/phpunit/src/Util/Log/JUnit.php
Risky test.
PHPUnit_Util_Log_JUnit::addSkippedTest in vendor/phpunit/phpunit/src/Util/Log/JUnit.php
Skipped test.

... See full list

File

vendor/phpunit/phpunit/src/Util/XML.php, line 28

Class

PHPUnit_Util_XML
XML helpers.

Code

public static function prepareString($string) {
  return preg_replace('/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/', '', htmlspecialchars(PHPUnit_Util_String::convertToUtf8($string), ENT_QUOTES, 'UTF-8'));
}