MDL-37457 testing Mark current classes as deprecated
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
* Module generator base class.
|
||||
*
|
||||
* @package core
|
||||
* @category testing
|
||||
* @category test
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
@@ -30,17 +30,26 @@
|
||||
* Extend in mod/xxxx/tests/generator/lib.php as class mod_xxxx_generator.
|
||||
*
|
||||
* @package core
|
||||
* @category testing
|
||||
* @category test
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
abstract class testing_module_generator {
|
||||
/** @var testing_data_generator@var */
|
||||
|
||||
/**
|
||||
* @var testing_data_generator
|
||||
*/
|
||||
protected $datagenerator;
|
||||
|
||||
/** @var number of created instances */
|
||||
/**
|
||||
* @var number of created instances
|
||||
*/
|
||||
protected $instancecount = 0;
|
||||
|
||||
/**
|
||||
* Dumb constructor to throw the deprecated notification
|
||||
* @param testing_data_generator $datagenerator
|
||||
*/
|
||||
public function __construct(testing_data_generator $datagenerator) {
|
||||
$this->datagenerator = $datagenerator;
|
||||
}
|
||||
@@ -73,9 +82,9 @@ abstract class testing_module_generator {
|
||||
|
||||
/**
|
||||
* Create course module and link it to course
|
||||
* @param int $courseid
|
||||
* @param array $options: section, visible
|
||||
* @return int $cm instance id
|
||||
* @param integer $courseid
|
||||
* @param array $options section, visible
|
||||
* @return integer $cm instance id
|
||||
*/
|
||||
protected function precreate_course_module($courseid, array $options) {
|
||||
global $DB, $CFG;
|
||||
@@ -140,3 +149,26 @@ abstract class testing_module_generator {
|
||||
*/
|
||||
abstract public function create_instance($record = null, array $options = null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated in favour of testing_module_generator
|
||||
*
|
||||
* @deprecated since Moodle 2.5 MDL-37457 - please do not use this function any more.
|
||||
* @todo MDL-37517 This will be deleted in Moodle 2.7
|
||||
* @see testing_module_generator
|
||||
* @package core
|
||||
* @category test
|
||||
* @copyright 2012 David Monllaó
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
abstract class phpunit_module_generator extends testing_module_generator {
|
||||
|
||||
/**
|
||||
* Dumb constructor to throw the deprecated notification
|
||||
* @param testing_data_generator $datagenerator
|
||||
*/
|
||||
public function __construct(testing_data_generator $datagenerator) {
|
||||
debugging('Class phpunit_module_generator is deprecated, please use class testing_module_generator instead', DEBUG_DEVELOPER);
|
||||
parent::__construct($datagenerator);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user