0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-14 01:08:41 +00:00
htmlpurifier/tests/HTMLPurifier/LanguageTest.php
2007-06-18 02:25:27 +00:00

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');
}
}
?>