mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-13 00:38: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:
parent
728088f2ba
commit
e66a98c396
@ -5,7 +5,7 @@
|
|||||||
$fallback = 'en';
|
$fallback = 'en';
|
||||||
|
|
||||||
$messages = array(
|
$messages = array(
|
||||||
'htmlpurifier' => 'HTML Purifier X'
|
'HTMLPurifier' => 'HTML Purifier X'
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
@ -4,8 +4,8 @@ $fallback = false;
|
|||||||
|
|
||||||
$messages = array(
|
$messages = array(
|
||||||
|
|
||||||
'htmlpurifier' => 'HTML Purifier',
|
'HTMLPurifier' => 'HTML Purifier',
|
||||||
'pizza' => 'Pizza', // for unit testing purposes
|
'LanguageFactoryTest: Pizza' => 'Pizza', // for unit testing purposes
|
||||||
|
|
||||||
'ErrorCollector: No errors' => 'No errors',
|
'ErrorCollector: No errors' => 'No errors',
|
||||||
'ErrorCollector: At line' => ' at line $line',
|
'ErrorCollector: At line' => ' at line $line',
|
||||||
|
@ -35,10 +35,10 @@ class HTMLPurifier_LanguageFactoryTest extends UnitTestCase
|
|||||||
$language->load();
|
$language->load();
|
||||||
|
|
||||||
// test overloaded message
|
// test overloaded message
|
||||||
$this->assertIdentical($language->getMessage('htmlpurifier'), 'HTML Purifier X');
|
$this->assertIdentical($language->getMessage('HTMLPurifier'), 'HTML Purifier X');
|
||||||
|
|
||||||
// test inherited message
|
// test inherited message
|
||||||
$this->assertIdentical($language->getMessage('pizza'), 'Pizza');
|
$this->assertIdentical($language->getMessage('LanguageFactoryTest: Pizza'), 'Pizza');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,16 +10,16 @@ class HTMLPurifier_LanguageTest extends UnitTestCase
|
|||||||
function test_getMessage() {
|
function test_getMessage() {
|
||||||
$lang = new HTMLPurifier_Language();
|
$lang = new HTMLPurifier_Language();
|
||||||
$lang->_loaded = true;
|
$lang->_loaded = true;
|
||||||
$lang->messages['htmlpurifier'] = 'HTML Purifier';
|
$lang->messages['HTMLPurifier'] = 'HTML Purifier';
|
||||||
$this->assertIdentical($lang->getMessage('htmlpurifier'), 'HTML Purifier');
|
$this->assertIdentical($lang->getMessage('HTMLPurifier'), 'HTML Purifier');
|
||||||
$this->assertIdentical($lang->getMessage('totally-non-existent-key'), '[totally-non-existent-key]');
|
$this->assertIdentical($lang->getMessage('LanguageTest: Totally non-existent key'), '[LanguageTest: Totally non-existent key]');
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_formatMessage() {
|
function test_formatMessage() {
|
||||||
$lang = new HTMLPurifier_Language();
|
$lang = new HTMLPurifier_Language();
|
||||||
$lang->_loaded = true;
|
$lang->_loaded = true;
|
||||||
$lang->messages['error'] = 'Error is $1 on line $2';
|
$lang->messages['LanguageTest: Error'] = 'Error is $1 on line $2';
|
||||||
$this->assertIdentical($lang->formatMessage('error', array(1=>'fatal', 32)), 'Error is fatal on line 32');
|
$this->assertIdentical($lang->formatMessage('LanguageTest: Error', array(1=>'fatal', 32)), 'Error is fatal on line 32');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user