1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-17 02:34:11 +02:00

html encode and decode

This commit is contained in:
Jarrett Croll
2015-06-16 12:27:20 -04:00
parent f1009d0267
commit f9729788c4
6 changed files with 146 additions and 0 deletions

View File

@@ -1023,4 +1023,26 @@ abstract class CommonTest extends PHPUnit_Framework_TestCase
array('fòô', 'bàř', '[[:alpha:]]{3}', 'fòô', 'msr', 'UTF-8')
);
}
public function htmlEncodeProvider()
{
return array(
array('&', '&'),
array('"', '"'),
array(''', "'", ENT_QUOTES),
array('&lt;', '<'),
array('&gt;', '>'),
);
}
public function htmlDecodeProvider()
{
return array(
array('&', '&amp;'),
array('"', '&quot;'),
array("'", '&#039;', ENT_QUOTES),
array('<', '&lt;'),
array('>', '&gt;'),
);
}
}