| Línea 27... |
Línea 27... |
| 27 |
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
27 |
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
| 28 |
*/
|
28 |
*/
|
| 29 |
class manager_test extends \advanced_testcase {
|
29 |
class manager_test extends \advanced_testcase {
|
| Línea 30... |
Línea 30... |
| 30 |
|
30 |
|
| 31 |
/** Test check_configuration by default **/
|
31 |
/** Test check_configuration by default **/
|
| 32 |
public function test_check_configuration_default() {
|
32 |
public function test_check_configuration_default(): void {
|
| 33 |
global $CFG;
|
33 |
global $CFG;
|
| Línea 34... |
Línea 34... |
| 34 |
$this->resetAfterTest(true);
|
34 |
$this->resetAfterTest(true);
|
| Línea 48... |
Línea 48... |
| 48 |
$this->assertEquals(\core\check\result::ERROR, $checks[5]->get_status()); // Missing access key.
|
48 |
$this->assertEquals(\core\check\result::ERROR, $checks[5]->get_status()); // Missing access key.
|
| 49 |
$this->assertEquals(\core\check\result::ERROR, $checks[7]->get_status()); // No registered devices yet.
|
49 |
$this->assertEquals(\core\check\result::ERROR, $checks[7]->get_status()); // No registered devices yet.
|
| 50 |
}
|
50 |
}
|
| Línea 51... |
Línea 51... |
| 51 |
|
51 |
|
| 52 |
/** Test check_configuration with token **/
|
52 |
/** Test check_configuration with token **/
|
| 53 |
public function test_check_configuration_with_token() {
|
53 |
public function test_check_configuration_with_token(): void {
|
| 54 |
global $CFG;
|
54 |
global $CFG;
|
| Línea 55... |
Línea 55... |
| 55 |
$this->resetAfterTest(true);
|
55 |
$this->resetAfterTest(true);
|
| Línea 71... |
Línea 71... |
| 71 |
// The original function fourth check (access key valid in the remote Airnotifier server) is not mockable.
|
71 |
// The original function fourth check (access key valid in the remote Airnotifier server) is not mockable.
|
| 72 |
$this->assertEquals(\core\check\result::ERROR, $checks[6]->get_status()); // No registered devices yet.
|
72 |
$this->assertEquals(\core\check\result::ERROR, $checks[6]->get_status()); // No registered devices yet.
|
| 73 |
}
|
73 |
}
|
| Línea 74... |
Línea 74... |
| 74 |
|
74 |
|
| 75 |
/** Test check_configuration bad settings **/
|
75 |
/** Test check_configuration bad settings **/
|
| 76 |
public function test_check_configuration_incorrect_settings() {
|
76 |
public function test_check_configuration_incorrect_settings(): void {
|
| 77 |
global $CFG;
|
77 |
global $CFG;
|
| Línea 78... |
Línea 78... |
| 78 |
$this->resetAfterTest(true);
|
78 |
$this->resetAfterTest(true);
|
| Línea 98... |
Línea 98... |
| 98 |
// The original function fifth check (access key valid in the remote Airnotifier server) is not mockable.
|
98 |
// The original function fifth check (access key valid in the remote Airnotifier server) is not mockable.
|
| 99 |
$this->assertEquals(\core\check\result::ERROR, $checks[7]->get_status()); // No registered devices yet.
|
99 |
$this->assertEquals(\core\check\result::ERROR, $checks[7]->get_status()); // No registered devices yet.
|
| 100 |
}
|
100 |
}
|
| Línea 101... |
Línea 101... |
| 101 |
|
101 |
|
| 102 |
/** Test has_enabled_devices **/
|
102 |
/** Test has_enabled_devices **/
|
| 103 |
public function test_has_enabled_devices() {
|
103 |
public function test_has_enabled_devices(): void {
|
| 104 |
global $CFG, $DB, $USER;
|
104 |
global $CFG, $DB, $USER;
|
| Línea 105... |
Línea 105... |
| 105 |
$this->resetAfterTest(true);
|
105 |
$this->resetAfterTest(true);
|
| 106 |
|
106 |
|