diff --git a/backup/controller/tests/controller_test.php b/backup/controller/tests/controller_test.php index 8ea8d966a6c..b9ff372bad7 100644 --- a/backup/controller/tests/controller_test.php +++ b/backup/controller/tests/controller_test.php @@ -30,7 +30,7 @@ require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php'); /* * controller tests (all) */ -class backup_controller_test extends advanced_testcase { +class backup_controller_testcase extends advanced_testcase { protected $moduleid; // course_modules id used for testing protected $sectionid; // course_sections id used for testing diff --git a/backup/converter/moodle1/tests/lib_test.php b/backup/converter/moodle1/tests/lib_test.php index 0a7eaa5bc06..4b31157936b 100644 --- a/backup/converter/moodle1/tests/lib_test.php +++ b/backup/converter/moodle1/tests/lib_test.php @@ -30,7 +30,7 @@ global $CFG; require_once($CFG->dirroot . '/backup/converter/moodle1/lib.php'); -class moodle1_converter_test extends advanced_testcase { +class moodle1_converter_testcase extends advanced_testcase { /** @var string the name of the directory containing the unpacked Moodle 1.9 backup */ protected $tempdir; diff --git a/backup/util/checks/tests/checks_test.php b/backup/util/checks/tests/checks_test.php index 9bfd1fc01a1..ccee3bad6b5 100644 --- a/backup/util/checks/tests/checks_test.php +++ b/backup/util/checks/tests/checks_test.php @@ -32,7 +32,7 @@ require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php'); /* * check tests (all) */ -class backup_check_test extends advanced_testcase { +class backup_check_testcase extends advanced_testcase { protected $moduleid; // course_modules id used for testing protected $sectionid; // course_sections id used for testing diff --git a/backup/util/dbops/tests/dbops_test.php b/backup/util/dbops/tests/dbops_test.php index 219912cbe4f..43682a53dc5 100644 --- a/backup/util/dbops/tests/dbops_test.php +++ b/backup/util/dbops/tests/dbops_test.php @@ -31,7 +31,7 @@ require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php'); /* * dbops tests (all) */ -class backup_dbops_test extends advanced_testcase { +class backup_dbops_testcase extends advanced_testcase { protected $moduleid; // course_modules id used for testing protected $sectionid; // course_sections id used for testing diff --git a/backup/util/destinations/tests/destinations_test.php b/backup/util/destinations/tests/destinations_test.php index d0f88ecd856..42da3811153 100644 --- a/backup/util/destinations/tests/destinations_test.php +++ b/backup/util/destinations/tests/destinations_test.php @@ -30,7 +30,7 @@ global $CFG; /** * dbops tests (all) */ -class backup_destinations_test extends basic_testcase { +class backup_destinations_testcase extends basic_testcase { /** * test backup_destination class diff --git a/backup/util/factories/tests/factories_test.php b/backup/util/factories/tests/factories_test.php index f730ef2eda3..9e3a4822447 100644 --- a/backup/util/factories/tests/factories_test.php +++ b/backup/util/factories/tests/factories_test.php @@ -38,7 +38,7 @@ require_once($CFG->dirroot . '/backup/util/factories/backup_factory.class.php'); /** * backup_factory tests (all) */ -class backup_factories_test extends advanced_testcase { +class backup_factories_testcase extends advanced_testcase { function setUp() { global $CFG; diff --git a/backup/util/helper/tests/converterhelper_test.php b/backup/util/helper/tests/converterhelper_test.php index b7d12d13dea..7824ab26d31 100644 --- a/backup/util/helper/tests/converterhelper_test.php +++ b/backup/util/helper/tests/converterhelper_test.php @@ -42,7 +42,7 @@ class testable_convert_helper extends convert_helper { /** * Defines the test methods */ -class backup_convert_helper_test extends basic_testcase { +class backup_convert_helper_testcase extends basic_testcase { public function test_choose_conversion_path() { diff --git a/backup/util/helper/tests/decode_test.php b/backup/util/helper/tests/decode_test.php index df0ac6bbfc8..b55178a5990 100644 --- a/backup/util/helper/tests/decode_test.php +++ b/backup/util/helper/tests/decode_test.php @@ -31,7 +31,7 @@ require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php'); /** * restore_decode tests (both rule and content) */ -class backup_restore_decode_test extends basic_testcase { +class backup_restore_decode_testcase extends basic_testcase { /** * test restore_decode_rule class diff --git a/backup/util/helper/tests/helper_test.php b/backup/util/helper/tests/helper_test.php index fdac0875fd8..27d193ff790 100644 --- a/backup/util/helper/tests/helper_test.php +++ b/backup/util/helper/tests/helper_test.php @@ -33,7 +33,7 @@ require_once($CFG->dirroot . '/backup/util/helper/backup_general_helper.class.ph /* * backup_helper tests (all) */ -class backup_helper_test extends basic_testcase { +class backup_helper_testcase extends basic_testcase { /* * test backup_helper class diff --git a/backup/util/loggers/tests/logger_test.php b/backup/util/loggers/tests/logger_test.php index 9dab0e29d47..799632ff0b9 100644 --- a/backup/util/loggers/tests/logger_test.php +++ b/backup/util/loggers/tests/logger_test.php @@ -38,7 +38,7 @@ require_once($CFG->dirroot . '/backup/util/loggers/file_logger.class.php'); /** * logger tests (all) */ -class backup_logger_test extends basic_testcase { +class backup_logger_testcase extends basic_testcase { /** * test base_logger class diff --git a/backup/util/plan/tests/plan_test.php b/backup/util/plan/tests/plan_test.php index a3eb240f815..bfc98f301a4 100644 --- a/backup/util/plan/tests/plan_test.php +++ b/backup/util/plan/tests/plan_test.php @@ -29,7 +29,7 @@ require_once(__DIR__.'/fixtures/plan_fixtures.php'); /** * plan tests (all) */ -class backup_plan_test extends advanced_testcase { +class backup_plan_testcase extends advanced_testcase { protected $moduleid; // course_modules id used for testing protected $sectionid; // course_sections id used for testing diff --git a/backup/util/plan/tests/step_test.php b/backup/util/plan/tests/step_test.php index b9a2e6d830a..44afd8d74c1 100644 --- a/backup/util/plan/tests/step_test.php +++ b/backup/util/plan/tests/step_test.php @@ -29,7 +29,7 @@ require_once(__DIR__.'/fixtures/plan_fixtures.php'); /* * step tests (all) */ -class backup_step_test extends advanced_testcase { +class backup_step_testcase extends advanced_testcase { protected $moduleid; // course_modules id used for testing protected $sectionid; // course_sections id used for testing diff --git a/backup/util/plan/tests/task_test.php b/backup/util/plan/tests/task_test.php index ef26f9b9c8a..efc1b6011a2 100644 --- a/backup/util/plan/tests/task_test.php +++ b/backup/util/plan/tests/task_test.php @@ -29,7 +29,7 @@ require_once(__DIR__.'/fixtures/plan_fixtures.php'); /** * task tests (all) */ -class backup_task_test extends advanced_testcase { +class backup_task_testcase extends advanced_testcase { protected $moduleid; // course_modules id used for testing protected $sectionid; // course_sections id used for testing diff --git a/backup/util/settings/tests/settings_test.php b/backup/util/settings/tests/settings_test.php index 28590faf3f3..201d29e43b2 100644 --- a/backup/util/settings/tests/settings_test.php +++ b/backup/util/settings/tests/settings_test.php @@ -40,7 +40,7 @@ require_once($CFG->dirroot . '/backup/util/ui/backup_ui_setting.class.php'); /** * setting tests (all) */ -class backp_settings_test extends basic_testcase { +class backp_settings_testcase extends basic_testcase { /** * test base_setting class diff --git a/backup/util/structure/tests/baseatom_test.php b/backup/util/structure/tests/baseatom_test.php index d7dbfe713f0..0f829e8a64b 100644 --- a/backup/util/structure/tests/baseatom_test.php +++ b/backup/util/structure/tests/baseatom_test.php @@ -31,7 +31,7 @@ require_once(__DIR__.'/fixtures/structure_fixtures.php'); * Unit test case the base_atom class. Note: as it's abstract we are testing * mock_base_atom instantiable class instead */ -class backup_base_atom_test extends basic_testcase { +class backup_base_atom_testcase extends basic_testcase { /** * Correct base_atom_tests diff --git a/backup/util/structure/tests/baseattribute_test.php b/backup/util/structure/tests/baseattribute_test.php index 203ad555a95..e32d7ab9812 100644 --- a/backup/util/structure/tests/baseattribute_test.php +++ b/backup/util/structure/tests/baseattribute_test.php @@ -31,7 +31,7 @@ require_once(__DIR__.'/fixtures/structure_fixtures.php'); * Unit test case the base_attribute class. Note: No really much to test here as attribute is 100% * atom extension without new functionality (name/value) */ -class backup_base_attribute_test extends basic_testcase { +class backup_base_attribute_testcase extends basic_testcase { /** * Correct base_attribute tests diff --git a/backup/util/structure/tests/basefinalelement_test.php b/backup/util/structure/tests/basefinalelement_test.php index 7fc8c69e0af..f4156db7fd1 100644 --- a/backup/util/structure/tests/basefinalelement_test.php +++ b/backup/util/structure/tests/basefinalelement_test.php @@ -30,7 +30,7 @@ require_once(__DIR__.'/fixtures/structure_fixtures.php'); /** * Unit test case the base_final_element class. Note: highly imbricated with base_nested_element class */ -class backup_base_final_element_test extends basic_testcase { +class backup_base_final_element_testcase extends basic_testcase { /** * Correct base_final_element tests diff --git a/backup/util/structure/tests/basenestedelement_test.php b/backup/util/structure/tests/basenestedelement_test.php index 5b2fe9adbbe..cdafd83e95d 100644 --- a/backup/util/structure/tests/basenestedelement_test.php +++ b/backup/util/structure/tests/basenestedelement_test.php @@ -30,7 +30,7 @@ require_once(__DIR__.'/fixtures/structure_fixtures.php'); /** * Unit test case the base_nested_element class. Note: highly imbricated with base_final_element class */ -class backup_base_nested_element_test extends basic_testcase { +class backup_base_nested_element_testcase extends basic_testcase { /** * Correct creation tests (attributes and final elements) diff --git a/backup/util/structure/tests/baseoptiogroup_test.php b/backup/util/structure/tests/baseoptiogroup_test.php index bf229008de3..7d70be9047b 100644 --- a/backup/util/structure/tests/baseoptiogroup_test.php +++ b/backup/util/structure/tests/baseoptiogroup_test.php @@ -30,7 +30,7 @@ require_once(__DIR__.'/fixtures/structure_fixtures.php'); /** * Unit test case the base_optigroup class. Note: highly imbricated with nested/final base elements */ -class backup_base_optigroup_test extends basic_testcase { +class backup_base_optigroup_testcase extends basic_testcase { /** * Correct creation tests (s) diff --git a/backup/util/structure/tests/structure_test.php b/backup/util/structure/tests/structure_test.php index adfc658a764..c8870cc38e5 100644 --- a/backup/util/structure/tests/structure_test.php +++ b/backup/util/structure/tests/structure_test.php @@ -33,7 +33,7 @@ require_once($CFG->dirroot . '/backup/util/xml/output/memory_xml_output.class.ph /** * Unit test case the all the backup structure classes. Note: Uses database */ -class backup_structure_test extends advanced_testcase { +class backup_structure_testcase extends advanced_testcase { protected $forumid; // To store the inserted forum->id protected $contextid; // Official contextid for these tests diff --git a/backup/util/ui/tests/ui_test.php b/backup/util/ui/tests/ui_test.php index 27e6d37cbb3..9bccb8d40f1 100644 --- a/backup/util/ui/tests/ui_test.php +++ b/backup/util/ui/tests/ui_test.php @@ -30,7 +30,7 @@ global $CFG; /** * ui tests (all) */ -class backup_ui_test extends basic_testcase { +class backup_ui_testcase extends basic_testcase { /** * test backup_ui class diff --git a/backup/util/xml/tests/writer_test.php b/backup/util/xml/tests/writer_test.php index 76a5d2ea9f6..d255dd5534f 100644 --- a/backup/util/xml/tests/writer_test.php +++ b/backup/util/xml/tests/writer_test.php @@ -33,7 +33,7 @@ require_once($CFG->dirroot . '/backup/util/xml/contenttransformer/xml_contenttra /** * xml_writer tests */ -class xml_writer_test extends basic_testcase { +class xml_writer_testcase extends basic_testcase { /** * test xml_writer public methods diff --git a/blog/tests/bloglib_test.php b/blog/tests/bloglib_test.php index 15d1a93b56e..3ad949cc562 100644 --- a/blog/tests/bloglib_test.php +++ b/blog/tests/bloglib_test.php @@ -32,7 +32,7 @@ require_once($CFG->dirroot . '/blog/lib.php'); /** * Test functions that rely on the DB tables */ -class bloglib_test extends advanced_testcase { +class bloglib_testcase extends advanced_testcase { private $courseid; // To store important ids to be used in tests private $groupid; diff --git a/lib/ajax/tests/ajaxlib_test.php b/lib/ajax/tests/ajaxlib_test.php index 9a2db87dfeb..844fc5df1bc 100644 --- a/lib/ajax/tests/ajaxlib_test.php +++ b/lib/ajax/tests/ajaxlib_test.php @@ -35,7 +35,7 @@ require_once($CFG->libdir . '/ajax/ajaxlib.php'); * @copyright 2008 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class ajax_test extends advanced_testcase { +class ajax_testcase extends advanced_testcase { var $user_agents = array( 'MSIE' => array( diff --git a/lib/phpunit/generatorlib.php b/lib/phpunit/generatorlib.php index 07242a86bb5..45ca5598f4d 100644 --- a/lib/phpunit/generatorlib.php +++ b/lib/phpunit/generatorlib.php @@ -25,6 +25,9 @@ defined('MOODLE_INTERNAL') || die(); +/** + * Data generator for unit tests + */ class phpunit_data_generator { protected $usercounter = 0; protected $categorycount = 0; @@ -49,7 +52,7 @@ class phpunit_data_generator { * Create a test user * @param array|stdClass $record * @param array $options - * @return stdClass + * @return stdClass user record */ public function create_user($record=null, array $options=null) { global $DB, $CFG; @@ -135,7 +138,7 @@ class phpunit_data_generator { * Create a test course category * @param array|stdClass $record * @param array $options - * @return stdClass + * @return stdClass course category record */ function create_category($record=null, array $options=null) { global $DB, $CFG; @@ -193,7 +196,7 @@ class phpunit_data_generator { * Create a test course * @param array|stdClass $record * @param array $options - * @return stdClass + * @return stdClass course record */ function create_course($record=null, array $options=null) { global $DB, $CFG; @@ -251,7 +254,7 @@ class phpunit_data_generator { * @param string $blockname * @param array|stdClass $record * @param array $options - * @return stdClass + * @return stdClass block instance record */ public function create_block($blockname, $record=null, array $options=null) { global $DB; @@ -296,7 +299,7 @@ class phpunit_data_generator { * @param string $modulename * @param array|stdClass $record * @param array $options - * @return stdClass + * @return stdClass activity record */ public function create_module($modulename, $record=null, array $options=null) { global $DB, $CFG; diff --git a/lib/tests/componentlib_test.php b/lib/tests/componentlib_test.php index 4ac2e76fad1..cbe0713dd07 100644 --- a/lib/tests/componentlib_test.php +++ b/lib/tests/componentlib_test.php @@ -28,7 +28,7 @@ defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->libdir.'/componentlib.class.php'); -class componentlib_test extends advanced_testcase { +class componentlib_testcase extends advanced_testcase { public function test_component_installer() { global $CFG; diff --git a/lib/tests/cssslib_test.php b/lib/tests/cssslib_test.php index 1fd9d1f4213..d68c09b0469 100644 --- a/lib/tests/cssslib_test.php +++ b/lib/tests/cssslib_test.php @@ -37,7 +37,7 @@ require_once($CFG->libdir . '/csslib.php'); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class css_optimiser_test extends advanced_testcase { +class css_optimiser_testcase extends advanced_testcase { /** * Sets up the test class diff --git a/lib/tests/eventslib_test.php b/lib/tests/eventslib_test.php index fd153961a22..33757770adb 100644 --- a/lib/tests/eventslib_test.php +++ b/lib/tests/eventslib_test.php @@ -94,7 +94,7 @@ class sample_handler_class { } } -class eventslib_test extends advanced_testcase { +class eventslib_testcase extends advanced_testcase { /** * Create temporary entries in the database for these tests. diff --git a/lib/tests/externallib_test.php b/lib/tests/externallib_test.php index 59b16921da9..5bd6e067364 100644 --- a/lib/tests/externallib_test.php +++ b/lib/tests/externallib_test.php @@ -29,7 +29,7 @@ global $CFG; require_once($CFG->libdir . '/externallib.php'); -class externallib_test extends basic_testcase { +class externallib_testcase extends basic_testcase { public function test_validate_params() { $params = array('text'=>'aaa', 'someid'=>'6',); $description = new external_function_parameters(array('someid' => new external_value(PARAM_INT, 'Some int value'), diff --git a/lib/tests/filelib_test.php b/lib/tests/filelib_test.php index 92c82d7d656..5ef866a6a5c 100644 --- a/lib/tests/filelib_test.php +++ b/lib/tests/filelib_test.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->libdir . '/filelib.php'); -class filelib_test extends basic_testcase { +class filelib_testcase extends basic_testcase { public function test_format_postdata_for_curlcall() { //POST params with just simple types diff --git a/lib/tests/filter_test.php b/lib/tests/filter_test.php index 20dc44bf5e5..1c8f0557895 100644 --- a/lib/tests/filter_test.php +++ b/lib/tests/filter_test.php @@ -32,7 +32,7 @@ require_once($CFG->libdir . '/filterlib.php'); /** * Test functions that affect filter_active table with contextid = $syscontextid. */ -class filter_active_global_test extends advanced_testcase { +class filter_active_global_testcase extends advanced_testcase { protected function setUp() { global $DB; @@ -234,7 +234,7 @@ class filter_active_global_test extends advanced_testcase { /** * Test functions that affect filter_active table with contextid = $syscontextid. */ -class filter_active_local_test extends advanced_testcase { +class filter_active_local_testcase extends advanced_testcase { protected function setUp() { global $DB; @@ -315,7 +315,7 @@ class filter_active_local_test extends advanced_testcase { /** * Test functions that use just the filter_config table. */ -class filter_config_test extends advanced_testcase { +class filter_config_testcase extends advanced_testcase { protected function setUp() { global $DB; @@ -368,7 +368,7 @@ class filter_config_test extends advanced_testcase { } -class filter_get_active_available_in_context_test extends advanced_testcase { +class filter_get_active_available_in_context_testcase extends advanced_testcase { private static $syscontext; private static $childcontext; private static $childcontext2; @@ -541,7 +541,7 @@ class filter_get_active_available_in_context_test extends advanced_testcase { } -class filter_preload_activities_test extends advanced_testcase { +class filter_preload_activities_testcase extends advanced_testcase { private static $syscontext; private static $catcontext; private static $coursecontext; @@ -652,7 +652,7 @@ class filter_preload_activities_test extends advanced_testcase { } -class filter_delete_config_test extends advanced_testcase { +class filter_delete_config_testcase extends advanced_testcase { protected function setUp() { global $DB; parent::setUp(); diff --git a/lib/tests/moodlelib_test.php b/lib/tests/moodlelib_test.php index af6125e7529..e00c015405f 100644 --- a/lib/tests/moodlelib_test.php +++ b/lib/tests/moodlelib_test.php @@ -30,7 +30,7 @@ global $CFG; require_once($CFG->libdir . '/moodlelib.php'); -class moodlelib_test extends advanced_testcase { +class moodlelib_testcase extends advanced_testcase { public static $includecoverage = array('lib/moodlelib.php'); diff --git a/lib/tests/phpunit_test.php b/lib/tests/phpunit_test.php index d8b16cf1a49..aec55877964 100644 --- a/lib/tests/phpunit_test.php +++ b/lib/tests/phpunit_test.php @@ -26,6 +26,7 @@ defined('MOODLE_INTERNAL') || die(); + /** * Test basic_testcase extra features and PHPUnit Moodle integration. * diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a47829b1b52..bd6a7a4b26d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -20,19 +20,13 @@ lib/tests - - lib/ajax/tests - - - lib/ddl/tests - - - lib/dml/tests - - lib/form/tests + + lib/ddl/tests + lib/dml/tests + backup/controller/tests backup/converter/moodle1/tests