mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-16 21:41:31 +02:00
Issue #47 - CLI will fail if outage plugin is not enabled.
This commit is contained in:
@@ -79,4 +79,17 @@ class cli_test extends cli_testcase {
|
||||
public function test_exception() {
|
||||
throw new cli_exception('An CLI exception.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException auth_outage\local\cli\cli_exception
|
||||
* @expectedExceptionCode 8
|
||||
*/
|
||||
public function test_authdisabled() {
|
||||
// Disable all auth plugins.
|
||||
set_config('auth', '');
|
||||
\core\session\manager::gc(); // Remove stale sessions.
|
||||
core_plugin_manager::reset_caches();
|
||||
// Try to create an CLI
|
||||
$cli = new create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,11 @@ defined('MOODLE_INTERNAL') || die();
|
||||
*/
|
||||
class cli_testcase extends advanced_testcase {
|
||||
public function setUp() {
|
||||
// Enable auth plugins.
|
||||
set_config('auth', 'outage');
|
||||
\core\session\manager::gc(); // Remove stale sessions.
|
||||
core_plugin_manager::reset_caches();
|
||||
|
||||
$this->resetAfterTest(true);
|
||||
$this->set_parameters([]);
|
||||
parent::setUp();
|
||||
|
||||
Reference in New Issue
Block a user