mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
adding test that expects parameters of php translation to get HTML entities to get encoded
This commit is contained in:
parent
e56edb6c6b
commit
79d30c9410
|
@ -143,6 +143,13 @@ class I18nTest extends PHPUnit_Framework_TestCase
|
||||||
$this->assertEquals('some string + 1', I18n::_('some %s + %d', 'string', 1), 'browser language en');
|
$this->assertEquals('some string + 1', I18n::_('some %s + %d', 'string', 1), 'browser language en');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testHtmlEntityEncoding()
|
||||||
|
{
|
||||||
|
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'foobar';
|
||||||
|
I18n::loadTranslations();
|
||||||
|
$this->assertEquals('some ' . htmlentities('&<>"\'/`=', ENT_QUOTES | ENT_XHTML | ENT_DISALLOWED, 'UTF-8') . ' + 1', I18n::_('some %s + %d', '&<>"\'/`=', 1), 'browser language en');
|
||||||
|
}
|
||||||
|
|
||||||
public function testMessageIdsExistInAllLanguages()
|
public function testMessageIdsExistInAllLanguages()
|
||||||
{
|
{
|
||||||
$messageIds = array();
|
$messageIds = array();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user