Skip to content

Commit

Permalink
MDL-32323 make base test case classes abstract to prevent empty testc…
Browse files Browse the repository at this point in the history
…ase warnings, fix property access
  • Loading branch information
skodak committed Apr 10, 2012
1 parent 351f4bc commit a4d53e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
13 changes: 3 additions & 10 deletions question/engine/tests/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,21 +414,14 @@ public static function build_db_records(array $table) {
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class data_loading_method_test_base extends advanced_testcase {
abstract class data_loading_method_test_base extends advanced_testcase {
public function build_db_records(array $table) {
return testing_db_record_builder::build_db_records($table);
}
public function test_must_have_methods() {
// each test case must have at least one method..
}
}


class question_testcase extends advanced_testcase {

public function test_must_have_methods() {
// each test case must have at least one method..
}
abstract class question_testcase extends advanced_testcase {

public function assert($expectation, $compare, $message = '') {
$message = (isset($expectation->message) and $expectation->message !== '') ? $expectation->message : $message;
Expand Down Expand Up @@ -618,7 +611,7 @@ public function __construct($pattern, $message = '') {
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_walkthrough_test_base extends question_testcase {
abstract class qbehaviour_walkthrough_test_base extends question_testcase {
/** @var question_display_options */
protected $displayoptions;
/** @var question_usage_by_activity */
Expand Down
6 changes: 1 addition & 5 deletions question/engine/upgrade/tests/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function load_dataset($questionid, $selecteditem) {
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_upgrader_test_base extends advanced_testcase {
abstract class question_attempt_upgrader_test_base extends advanced_testcase {
protected $updater;
protected $loader;

Expand All @@ -109,10 +109,6 @@ protected function tearDown() {
parent::tearDown();
}

public function test_must_have_methods() {
// each test case must have at least one method..
}

/**
* Clear text, bringing independence of html2text results
*
Expand Down
4 changes: 2 additions & 2 deletions question/engine/upgrade/upgradelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ public function prepare_to_restore() {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_engine_upgrade_question_loader {
private $cache = array();
private $datasetcache = array();
protected $cache = array();
protected $datasetcache = array();

public function __construct($logger) {
$this->logger = $logger;
Expand Down

0 comments on commit a4d53e4

Please sign in to comment.