Permalink
Browse files

MDL-34962 Tidy up tests a bit

  • Loading branch information...
1 parent 6e52a71 commit 498bc10c3638da68a69fffe7d3b7882a2fb2c8c0 @stronk7 stronk7 committed Sep 11, 2012
Showing with 12 additions and 11 deletions.
  1. +12 −11 webservice/tests/externallib_test.php
@@ -17,7 +17,7 @@
defined('MOODLE_INTERNAL') || die();
global $CFG;
-
+require_once($CFG->dirroot . '/webservice/externallib.php');
require_once($CFG->dirroot . '/webservice/tests/helpers.php');
/**
@@ -30,23 +30,24 @@
*/
class core_webservice_external_testcase extends externallib_advanced_testcase {
- /**
- * Tests set up
- */
- protected function setUp() {
- global $CFG;
- require_once($CFG->dirroot . '/webservice/externallib.php');
- $_POST = array();
- // Enable the webservices and set a release number.
+ public function setUp() {
+ // Calling parent is good, always
+ parent::setUp();
+
+ // We always need enabled WS for this testcase
set_config('enablewebservices', '1');
- set_config('release', '2.4dev (Build: 20120823)');
- set_config('version', '2012083100.00');
}
public function test_get_site_info() {
global $DB, $USER, $CFG;
$this->resetAfterTest(true);
+
+ // This is the info we are going to check
+ set_config('release', '2.4dev (Build: 20120823)');
+ set_config('version', '2012083100.00');
+
+ // Set current user
$user = array();
$user['username'] = 'johnd';
$user['firstname'] = 'John';

0 comments on commit 498bc10

Please sign in to comment.