diff --git a/lib/grade/tests/grade_grade_test.php b/lib/grade/tests/grade_grade_test.php index 29f9a164ba2..fac84ffc3c5 100644 --- a/lib/grade/tests/grade_grade_test.php +++ b/lib/grade/tests/grade_grade_test.php @@ -126,11 +126,10 @@ class grade_grade_test extends \grade_base_testcase { $this->assertEquals(40, \grade_grade::standardise_score(50, 30, 80, 0, 100)); } - - /* - * Disabling this test: the set_locked() arguments have been modified, rendering these tests useless until they are re-written - - protected function test_grade_grade_set_locked() { + public function test_grade_grade_set_locked() { + // Skip this test because set_locked() arguments have been modified, rendering these tests + // useless until they are re-written. Note this comes from MDL-32323 (2012!). + $this->markTestSkipped('Useless set_locked() tests until they are re-written'); $grade_item = new \grade_item($this->grade_items[0]); $grade = new \grade_grade($grade_item->get_final(1)); $this->assertTrue(method_exists($grade, 'set_locked')); @@ -154,7 +153,6 @@ class grade_grade_test extends \grade_base_testcase { $this->assertTrue($grade->set_locked(true, false)); } - */ protected function sub_test_grade_grade_is_locked() { $grade = new \grade_grade($this->grade_grades[0], false); diff --git a/lib/phpunit/tests/basic_test.php b/lib/phpunit/tests/basic_test.php index 88ab7bd6ecb..3950434a8b8 100644 --- a/lib/phpunit/tests/basic_test.php +++ b/lib/phpunit/tests/basic_test.php @@ -223,43 +223,50 @@ STRING; ]; } - // Uncomment following tests to see logging of unexpected changes in global state and database. - /* - public function test_db_modification() { - global $DB; - $DB->set_field('user', 'confirmed', 1, array('id'=>-1)); - } + // The following tests are only useful when modifying the reset code and need to check tha + // changes in global state are being properly detected. Hence, they are skipped by default. + // To run them, remove the markTestSkipped() call when working in that area. - public function test_cfg_modification() { - global $CFG; - $CFG->xx = 'yy'; - unset($CFG->admin); - $CFG->rolesactive = 0; - } + public function test_db_modification() { + global $DB; + $this->markTestSkipped('This test is only useful to confirm that the reset stuff works as expected.'); + $DB->set_field('user', 'confirmed', 1, ['id' => -1]); + } - public function test_user_modification() { - global $USER; - $USER->id = 10; - } + public function test_cfg_modification() { + global $CFG; + $this->markTestSkipped('This test is only useful to confirm that the reset stuff works as expected.'); + $CFG->xx = 'yy'; + unset($CFG->admin); + $CFG->rolesactive = 0; + } - public function test_course_modification() { - global $COURSE; - $COURSE->id = 10; - } + public function test_user_modification() { + global $USER; + $this->markTestSkipped('This test is only useful to confirm that the reset stuff works as expected.'); + $USER->id = 10; + } - public function test_all_modifications() { - global $DB, $CFG, $USER, $COURSE; - $DB->set_field('user', 'confirmed', 1, array('id'=>-1)); - $CFG->xx = 'yy'; - unset($CFG->admin); - $CFG->rolesactive = 0; - $USER->id = 10; - $COURSE->id = 10; - } + public function test_course_modification() { + global $COURSE; + $this->markTestSkipped('This test is only useful to confirm that the reset stuff works as expected.'); + $COURSE->id = 10; + } - public function test_transaction_problem() { - global $DB; - $DB->start_delegated_transaction(); - } - */ + public function test_all_modifications() { + global $DB, $CFG, $USER, $COURSE; + $this->markTestSkipped('This test is only useful to confirm that the reset stuff works as expected.'); + $DB->set_field('user', 'confirmed', 1, ['id' => -1]); + $CFG->xx = 'yy'; + unset($CFG->admin); + $CFG->rolesactive = 0; + $USER->id = 10; + $COURSE->id = 10; + } + + public function test_transaction_problem() { + global $DB; + $this->markTestSkipped('This test is only useful to confirm that the reset stuff works as expected.'); + $DB->start_delegated_transaction(); + } } diff --git a/lib/tests/rtlcss_test.php b/lib/tests/rtlcss_test.php index bc6d327755f..80154dbd1b1 100644 --- a/lib/tests/rtlcss_test.php +++ b/lib/tests/rtlcss_test.php @@ -1129,12 +1129,11 @@ class rtlcss_test extends basic_testcase { * @param array $data the provider data. * @dataProvider background_image_provider */ - /* Not supported by MoodleHQ/RTLCSS yet. public function test_background_image($data) { + $this->markTestSkipped('Not yet supported!'); $output = new OutputFormat(); $this->assert_sample($data, $output); } - */ /** * Test background position. @@ -1197,14 +1196,13 @@ class rtlcss_test extends basic_testcase { * @param array $data the provider data. * @dataProvider special_provider */ - /* Not supported by MoodleHQ/RTLCSS yet. public function test_special($data) { + $this->markTestSkipped('Not yet supported!'); $output = new OutputFormat(); $output->set('SpaceBeforeRules', ' '); $output->set('SpaceAfterListArgumentSeparator', array('default' => '', ',' => ' ')); $this->assert_sample($data, $output); } - */ /** * Test transform original. @@ -1226,15 +1224,14 @@ class rtlcss_test extends basic_testcase { * @param array $data the provider data. * @dataProvider transforms_provider */ - /* Not supported by MoodleHQ/RTLCSS yet. public function test_transforms($data) { + $this->markTestSkipped('Not yet supported!'); $output = new OutputFormat(); $output->set('SpaceBeforeRules', ' '); $output->set('SpaceAfterRules', ' '); $output->set('SpaceAfterListArgumentSeparator', array('default' => '', ',' => ' ')); $this->assert_sample($data, $output); } - */ /** * Test values n-syntax.