mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-22 08:21:52 +00:00
Delete language tests that are interfering with PSR-0 compatibility
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
parent
3bdc031224
commit
ce7efc11b2
@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// private class for unit testing
|
|
||||||
|
|
||||||
class HTMLPurifier_Language_en_x_test extends HTMLPurifier_Language
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
|
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// private language message file for unit testing purposes
|
|
||||||
|
|
||||||
$fallback = 'en';
|
|
||||||
|
|
||||||
$messages = array(
|
|
||||||
'HTMLPurifier' => 'HTML Purifier X'
|
|
||||||
);
|
|
||||||
|
|
||||||
$errorNames = array();
|
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
|
@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// private language message file for unit testing purposes
|
|
||||||
// this language file has no class associated with it
|
|
||||||
|
|
||||||
$fallback = 'en';
|
|
||||||
|
|
||||||
$messages = array(
|
|
||||||
'HTMLPurifier' => 'HTML Purifier XNone'
|
|
||||||
);
|
|
||||||
|
|
||||||
$errorNames = array();
|
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
|
@ -29,45 +29,6 @@ class HTMLPurifier_LanguageFactoryTest extends HTMLPurifier_Harness
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testFallback()
|
|
||||||
{
|
|
||||||
$this->config->set('Core.Language', 'en-x-test');
|
|
||||||
$language = $this->factory->create($this->config, $this->context);
|
|
||||||
|
|
||||||
$this->assertIsA($language, 'HTMLPurifier_Language_en_x_test');
|
|
||||||
$this->assertIdentical($language->code, 'en-x-test');
|
|
||||||
|
|
||||||
$language->load();
|
|
||||||
|
|
||||||
// test overloaded message
|
|
||||||
$this->assertIdentical($language->getMessage('HTMLPurifier'), 'HTML Purifier X');
|
|
||||||
|
|
||||||
// test inherited message
|
|
||||||
$this->assertIdentical($language->getMessage('LanguageFactoryTest: Pizza'), 'Pizza');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testFallbackWithNoClass()
|
|
||||||
{
|
|
||||||
$this->config->set('Core.Language', 'en-x-testmini');
|
|
||||||
$language = $this->factory->create($this->config, $this->context);
|
|
||||||
$this->assertIsA($language, 'HTMLPurifier_Language');
|
|
||||||
$this->assertIdentical($language->code, 'en-x-testmini');
|
|
||||||
$language->load();
|
|
||||||
$this->assertIdentical($language->getMessage('HTMLPurifier'), 'HTML Purifier XNone');
|
|
||||||
$this->assertIdentical($language->getMessage('LanguageFactoryTest: Pizza'), 'Pizza');
|
|
||||||
$this->assertIdentical($language->error, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testNoSuchLanguage()
|
|
||||||
{
|
|
||||||
$this->config->set('Core.Language', 'en-x-testnone');
|
|
||||||
$language = $this->factory->create($this->config, $this->context);
|
|
||||||
$this->assertIsA($language, 'HTMLPurifier_Language');
|
|
||||||
$this->assertIdentical($language->code, 'en-x-testnone');
|
|
||||||
$this->assertIdentical($language->error, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
// vim: et sw=4 sts=4
|
||||||
|
Loading…
Reference in New Issue
Block a user