mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-41953 add more tests for invalid plugin names
This commit is contained in:
parent
a41d1ca0ce
commit
b5486ce89b
@ -205,6 +205,7 @@ class core_component_testcase extends advanced_testcase {
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('mod', 'example.xx'));
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('mod', '.example'));
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('mod', '_example'));
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('mod', 'example_'));
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('mod', 'example_x1'));
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('mod', 'example-x1'));
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('mod', 'role'));
|
||||
@ -220,6 +221,8 @@ class core_component_testcase extends advanced_testcase {
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('tool', 'example-xx'));
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('tool', '.example'));
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('tool', '_example'));
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('tool', 'example_'));
|
||||
$this->assertFalse(core_component::is_valid_plugin_name('tool', 'example__x1'));
|
||||
}
|
||||
|
||||
public function test_normalize_component() {
|
||||
|
@ -490,6 +490,7 @@ class core_moodlelib_testcase extends advanced_testcase {
|
||||
$this->assertSame('', clean_param('auth_something__xx', PARAM_COMPONENT));
|
||||
$this->assertSame('', clean_param('mod_Something', PARAM_COMPONENT));
|
||||
$this->assertSame('', clean_param('mod_somethíng', PARAM_COMPONENT));
|
||||
$this->assertSame('', clean_param('mod__something', PARAM_COMPONENT));
|
||||
$this->assertSame('', clean_param('auth_xx-yy', PARAM_COMPONENT));
|
||||
$this->assertSame('', clean_param('_auth_xx', PARAM_COMPONENT));
|
||||
$this->assertSame('', clean_param('a2uth_xx', PARAM_COMPONENT));
|
||||
|
Loading…
x
Reference in New Issue
Block a user