mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-23 00:41:52 +00:00
7699efd593
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1156 48356398-32a2-884e-a903-53898d9a118a
27 lines
796 B
PHP
27 lines
796 B
PHP
<?php
|
|
|
|
require_once 'HTMLPurifier/Language.php';
|
|
|
|
class HTMLPurifier_LanguageTest extends UnitTestCase
|
|
{
|
|
|
|
var $lang;
|
|
|
|
function test_getMessage() {
|
|
$lang = new HTMLPurifier_Language();
|
|
$lang->_loaded = true;
|
|
$lang->messages['htmlpurifier'] = 'HTML Purifier';
|
|
$this->assertIdentical($lang->getMessage('htmlpurifier'), 'HTML Purifier');
|
|
$this->assertIdentical($lang->getMessage('totally-non-existent-key'), '[totally-non-existent-key]');
|
|
}
|
|
|
|
function test_formatMessage() {
|
|
$lang = new HTMLPurifier_Language();
|
|
$lang->_loaded = true;
|
|
$lang->messages['error'] = 'Error is $1 on line $2';
|
|
$this->assertIdentical($lang->formatMessage('error', 'fatal', 32), 'Error is fatal on line 32');
|
|
}
|
|
|
|
}
|
|
|
|
?>
|