Merge branch 'MDL-54988-master' of git://github.com/junpataleta/moodle

This commit is contained in:
Dan Poltawski
2016-07-26 09:13:10 +01:00
3 changed files with 33 additions and 85 deletions
-42
View File
@@ -201,10 +201,6 @@ class core_modinfolib_testcase extends advanced_testcase {
$this->assertEquals(new moodle_url('/mod/assign/view.php', array('id' => $moduledb->id)), $cm->url);
$this->assertEquals($cachedcminfo->customdata, $cm->customdata);
// Deprecated field.
$this->assertEquals(0, $cm->groupmembersonly);
$this->assertDebuggingCalled();
// Dynamic fields, just test that they can be retrieved (must be carefully tested in each activity type).
$this->assertNotEmpty($cm->availableinfo); // Lists all unmet availability conditions.
$this->assertEquals(0, $cm->uservisible);
@@ -470,44 +466,6 @@ class core_modinfolib_testcase extends advanced_testcase {
$this->assertTrue($cm->is_user_access_restricted_by_capability());
}
/**
* Tests that various deprecated cm_info methods are throwing debuggign messages
*/
public function test_cm_info_property_deprecations() {
global $DB, $CFG;
$this->resetAfterTest();
$course = $this->getDataGenerator()->create_course( array('format' => 'topics', 'numsections' => 3),
array('createsections' => true));
$forum = $this->getDataGenerator()->create_module('forum', array('course' => $course->id));
$cm = get_fast_modinfo($course->id)->instances['forum'][$forum->id];
$cm->get_url();
$this->assertDebuggingCalled('cm_info::get_url() is deprecated, please use the property cm_info->url instead.');
$cm->get_content();
$this->assertDebuggingCalled('cm_info::get_content() is deprecated, please use the property cm_info->content instead.');
$cm->get_extra_classes();
$this->assertDebuggingCalled('cm_info::get_extra_classes() is deprecated, please use the property cm_info->extraclasses instead.');
$cm->get_on_click();
$this->assertDebuggingCalled('cm_info::get_on_click() is deprecated, please use the property cm_info->onclick instead.');
$cm->get_custom_data();
$this->assertDebuggingCalled('cm_info::get_custom_data() is deprecated, please use the property cm_info->customdata instead.');
$cm->get_after_link();
$this->assertDebuggingCalled('cm_info::get_after_link() is deprecated, please use the property cm_info->afterlink instead.');
$cm->get_after_edit_icons();
$this->assertDebuggingCalled('cm_info::get_after_edit_icons() is deprecated, please use the property cm_info->afterediticons instead.');
$cm->obtain_dynamic_data();
$this->assertDebuggingCalled('cm_info::obtain_dynamic_data() is deprecated and should not be used.');
}
/**
* Tests for function cm_info::get_course_module_record()
*/