This commit is contained in:
Sam Hemelryk
2014-03-19 21:22:24 +01:00
committed by Eloy Lafuente (stronk7)
6 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ class comment_created extends \core\event\comment_created {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/data/view.php', array('id' => $this->other['itemid']));
return new \moodle_url('/mod/data/view.php', array('id' => $this->contextinstanceid));
}
/**
+1 -1
View File
@@ -39,7 +39,7 @@ class comment_deleted extends \core\event\comment_deleted {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/data/view.php', array('id' => $this->other['itemid']));
return new \moodle_url('/mod/data/view.php', array('id' => $this->contextinstanceid));
}
/**
+2 -2
View File
@@ -163,7 +163,7 @@ class data_lib_testcase extends advanced_testcase {
// Checking that the event contains the expected values.
$this->assertInstanceOf('\mod_data\event\comment_created', $event);
$this->assertEquals($context, $event->get_context());
$url = new moodle_url('/mod/data/view.php', array('id' => $module->id));
$url = new moodle_url('/mod/data/view.php', array('id' => $module->cmid));
$this->assertEquals($url, $event->get_url());
$this->assertEventContextNotUsed($event);
}
@@ -227,7 +227,7 @@ class data_lib_testcase extends advanced_testcase {
// Checking that the event contains the expected values.
$this->assertInstanceOf('\mod_data\event\comment_deleted', $event);
$this->assertEquals($context, $event->get_context());
$url = new moodle_url('/mod/data/view.php', array('id' => $module->id));
$url = new moodle_url('/mod/data/view.php', array('id' => $module->cmid));
$this->assertEquals($url, $event->get_url());
$this->assertEventContextNotUsed($event);
}
@@ -39,7 +39,7 @@ class comment_created extends \core\event\comment_created {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/glossary/view.php', array('id' => $this->other['itemid']));
return new \moodle_url('/mod/glossary/view.php', array('id' => $this->contextinstanceid));
}
/**
@@ -39,7 +39,7 @@ class comment_deleted extends \core\event\comment_deleted {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/glossary/view.php', array('id' => $this->other['itemid']));
return new \moodle_url('/mod/glossary/view.php', array('id' => $this->contextinstanceid));
}
/**
+4 -4
View File
@@ -39,7 +39,7 @@ class glossary_event_testcase extends advanced_testcase {
* Test comment_created event.
*/
public function test_comment_created() {
global $CFG, $DB;
global $CFG;
require_once($CFG->dirroot . '/comment/lib.php');
$this->resetAfterTest();
@@ -74,7 +74,7 @@ class glossary_event_testcase extends advanced_testcase {
// Checking that the event contains the expected values.
$this->assertInstanceOf('\mod_glossary\event\comment_created', $event);
$this->assertEquals($context, $event->get_context());
$url = new moodle_url('/mod/glossary/view.php', array('id' => $glossary->id));
$url = new moodle_url('/mod/glossary/view.php', array('id' => $glossary->cmid));
$this->assertEquals($url, $event->get_url());
$this->assertEventContextNotUsed($event);
}
@@ -83,7 +83,7 @@ class glossary_event_testcase extends advanced_testcase {
* Test comment_deleted event.
*/
public function test_comment_deleted() {
global $CFG, $DB;
global $CFG;
require_once($CFG->dirroot . '/comment/lib.php');
$this->resetAfterTest();
@@ -119,7 +119,7 @@ class glossary_event_testcase extends advanced_testcase {
// Checking that the event contains the expected values.
$this->assertInstanceOf('\mod_glossary\event\comment_deleted', $event);
$this->assertEquals($context, $event->get_context());
$url = new moodle_url('/mod/glossary/view.php', array('id' => $glossary->id));
$url = new moodle_url('/mod/glossary/view.php', array('id' => $glossary->cmid));
$this->assertEquals($url, $event->get_url());
$this->assertEventContextNotUsed($event);
}