Skip to content
Browse files

MDL-30545 tests - use mod_assignment data generator

mod_assign doens't exist yet..!
  • Loading branch information...
1 parent 95f6a02 commit 1f5205b34417b9657c583265ccacf059e1422413 @danpoltawski danpoltawski committed Nov 13, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/tests/messagelib_test.php
View
8 lib/tests/messagelib_test.php
@@ -91,8 +91,8 @@ public function test_message_get_providers_for_user_more() {
// It would probably be better to use a quiz instance as it has capability controlled messages
// however mod_quiz doesn't have a data generator
// Instead we're going to use backup notifications and give and take away the capability at various levels
- $assign = $this->getDataGenerator()->create_module('assign', array('course'=>$course->id));
- $modulecontext = context_module::instance($assign->id);
+ $assignment = $this->getDataGenerator()->create_module('assignment', array('course'=>$course->id));
+ $modulecontext = context_module::instance($assignment->id);
// Create and enrol a teacher
$teacherrole = $DB->get_record('role', array('shortname'=>'editingteacher'), '*', MUST_EXIST);
@@ -120,7 +120,7 @@ public function test_message_get_providers_for_user_more() {
// They should now be able to see the backup message
assign_capability('moodle/site:config', CAP_ALLOW, $teacherrole->id, $modulecontext->id, true);
accesslib_clear_all_caches_for_unit_testing();
- $modulecontext = context_module::instance($assign->id);
+ $modulecontext = context_module::instance($assignment->id);
$this->assertTrue(has_capability('moodle/site:config', $modulecontext));
$providers = message_get_providers_for_user($teacher->id);
@@ -131,7 +131,7 @@ public function test_message_get_providers_for_user_more() {
// They should not be able to see the backup message
assign_capability('moodle/site:config', CAP_PROHIBIT, $teacherrole->id, $coursecontext->id, true);
accesslib_clear_all_caches_for_unit_testing();
- $modulecontext = context_module::instance($assign->id);
+ $modulecontext = context_module::instance($assignment->id);
$this->assertFalse(has_capability('moodle/site:config', $modulecontext));
$providers = message_get_providers_for_user($teacher->id);

0 comments on commit 1f5205b

Please sign in to comment.
Something went wrong with that request. Please try again.