mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-74886 core_admin: Add unit test
Simple unit test to verify we don't get the TypeError anymore.
This commit is contained in:
parent
91acfa2b50
commit
3fc9e345d0
@ -357,6 +357,17 @@ class core_admintree_testcase extends advanced_testcase {
|
||||
$this->assertSame('', get_config('abc_cde', 'execpath'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test setting an empty duration displays the correct validation message.
|
||||
*/
|
||||
public function test_emptydurationvalue() {
|
||||
$this->resetAfterTest();
|
||||
$adminsetting = new admin_setting_configduration('abc_cde/duration', 'some desc', '', '');
|
||||
|
||||
// A value that isn't a number is treated as a zero, so we expect to see no error message.
|
||||
$this->assertEmpty($adminsetting->write_setting(['u' => '3600', 'v' => 'abc']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test setting for blocked hosts
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user