/**
* This class is adapted from code coming from Zend Framework.
*
- * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (https://www.zend.com)
+ * @license https://framework.zend.com/license/new-bsd New BSD License
*/
-class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
+class Twig_Test_EscapingTest extends \PHPUnit\Framework\TestCase
{
/**
* All character encodings supported by htmlspecialchars().
protected $jsSpecialChars = array(
/* HTML special chars - escape without exception to hex */
- '<' => '\\x3C',
- '>' => '\\x3E',
- '\'' => '\\x27',
- '"' => '\\x22',
- '&' => '\\x26',
+ '<' => '\\u003C',
+ '>' => '\\u003E',
+ '\'' => '\\u0027',
+ '"' => '\\u0022',
+ '&' => '\\u0026',
+ '/' => '\\/',
/* Characters beyond ASCII value 255 to unicode escape */
'Ā' => '\\u0100',
+ '😀' => '\\uD83D\\uDE00',
/* Immune chars excluded */
',' => ',',
'.' => '.',
'0' => '0',
'9' => '9',
/* Basic control characters and null */
- "\r" => '\\x0D',
- "\n" => '\\x0A',
- "\t" => '\\x09',
- "\0" => '\\x00',
+ "\r" => '\r',
+ "\n" => '\n',
+ "\x08" => '\b',
+ "\t" => '\t',
+ "\x0C" => '\f',
+ "\0" => '\\u0000',
/* Encode spaces for quoteless attribute protection */
- ' ' => '\\x20',
+ ' ' => '\\u0020',
);
protected $urlSpecialChars = array(