2007-01-29 20:11:00 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once 'HTMLPurifier/Language.php';
|
|
|
|
|
|
|
|
class HTMLPurifier_LanguageTest extends UnitTestCase
|
|
|
|
{
|
|
|
|
|
|
|
|
var $lang;
|
|
|
|
|
2007-06-18 02:25:27 +00:00
|
|
|
function test_getMessage() {
|
|
|
|
$lang = new HTMLPurifier_Language();
|
|
|
|
$lang->_loaded = true;
|
2007-06-25 01:11:56 +00:00
|
|
|
$lang->messages['HTMLPurifier'] = 'HTML Purifier';
|
|
|
|
$this->assertIdentical($lang->getMessage('HTMLPurifier'), 'HTML Purifier');
|
|
|
|
$this->assertIdentical($lang->getMessage('LanguageTest: Totally non-existent key'), '[LanguageTest: Totally non-existent key]');
|
2007-01-29 20:11:00 +00:00
|
|
|
}
|
|
|
|
|
2007-06-18 02:25:27 +00:00
|
|
|
function test_formatMessage() {
|
|
|
|
$lang = new HTMLPurifier_Language();
|
|
|
|
$lang->_loaded = true;
|
2007-06-25 01:11:56 +00:00
|
|
|
$lang->messages['LanguageTest: Error'] = 'Error is $1 on line $2';
|
|
|
|
$this->assertIdentical($lang->formatMessage('LanguageTest: Error', array(1=>'fatal', 32)), 'Error is fatal on line 32');
|
2007-01-29 20:11:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|