Skip to content

Commit

Permalink
MDL-72210 phpunit: Remove excessive curl mock responses
Browse files Browse the repository at this point in the history
  • Loading branch information
golenkovm committed Aug 14, 2021
1 parent 707d09a commit 2af7fbc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions message/output/airnotifier/tests/manager_test.php
Expand Up @@ -33,8 +33,7 @@ public function test_check_configuration_default() {

// Mock server responses.
$CFG->airnotifierurl = 'localhost';
curl::mock_response(json_encode(['status' => 'ok'])); // Mock first request to check URL.
curl::mock_response(json_encode(['error' => 'Invalid access key'])); // Mock second request to check acces key.
curl::mock_response(json_encode(['error' => 'Invalid access key'])); // Mock request to check access key.
$checks = $manager->check_configuration();

$this->assertEquals(core\check\result::OK, $checks[0]->get_status()); // Mobile service enabled.
Expand Down Expand Up @@ -103,7 +102,6 @@ public function test_has_enabled_devices() {
$manager = new message_airnotifier_manager();

// No devices yet for current user.
curl::mock_response(json_encode(['status' => 'ok']));
$this->assertFalse($manager->has_enabled_devices($CFG->airnotifiermobileappname));

// Add devices.
Expand Down

0 comments on commit 2af7fbc

Please sign in to comment.