0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-09 23:28:42 +00:00

[2.0.1] Convert test language messages to use new format.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1229 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2007-06-25 01:11:56 +00:00
parent 728088f2ba
commit e66a98c396
4 changed files with 10 additions and 10 deletions

View File

@ -5,7 +5,7 @@
$fallback = 'en';
$messages = array(
'htmlpurifier' => 'HTML Purifier X'
'HTMLPurifier' => 'HTML Purifier X'
);
?>

View File

@ -4,8 +4,8 @@ $fallback = false;
$messages = array(
'htmlpurifier' => 'HTML Purifier',
'pizza' => 'Pizza', // for unit testing purposes
'HTMLPurifier' => 'HTML Purifier',
'LanguageFactoryTest: Pizza' => 'Pizza', // for unit testing purposes
'ErrorCollector: No errors' => 'No errors',
'ErrorCollector: At line' => ' at line $line',

View File

@ -35,10 +35,10 @@ class HTMLPurifier_LanguageFactoryTest extends UnitTestCase
$language->load();
// test overloaded message
$this->assertIdentical($language->getMessage('htmlpurifier'), 'HTML Purifier X');
$this->assertIdentical($language->getMessage('HTMLPurifier'), 'HTML Purifier X');
// test inherited message
$this->assertIdentical($language->getMessage('pizza'), 'Pizza');
$this->assertIdentical($language->getMessage('LanguageFactoryTest: Pizza'), 'Pizza');
}

View File

@ -10,16 +10,16 @@ class HTMLPurifier_LanguageTest extends UnitTestCase
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]');
$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]');
}
function test_formatMessage() {
$lang = new HTMLPurifier_Language();
$lang->_loaded = true;
$lang->messages['error'] = 'Error is $1 on line $2';
$this->assertIdentical($lang->formatMessage('error', array(1=>'fatal', 32)), 'Error is fatal on line 32');
$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');
}
}