Merge branch 'MDL-40963-master' of git://github.com/ankitagarwal/moodle
This commit is contained in:
@@ -240,7 +240,7 @@ abstract class base implements \IteratorAggregate {
|
||||
*/
|
||||
public static function get_name() {
|
||||
// Override in subclass with real lang string.
|
||||
$parts = explode('\\', __CLASS__);
|
||||
$parts = explode('\\', get_called_class());
|
||||
if (count($parts) !== 3) {
|
||||
return 'unknown event';
|
||||
}
|
||||
|
||||
@@ -702,6 +702,11 @@ class core_event_testcase extends advanced_testcase {
|
||||
}
|
||||
}
|
||||
|
||||
public function test_get_name() {
|
||||
$event = \core_tests\event\noname_event::create(array('courseid' => 1, 'other' => array('sample' => 1, 'xx' => 10)));
|
||||
$this->assertEquals("core_tests: noname event", $event->get_name());
|
||||
}
|
||||
|
||||
public function test_iteration() {
|
||||
$event = \core_tests\event\unittest_executed::create(array('courseid'=>1, 'context'=>\context_system::instance(), 'other'=>array('sample'=>1, 'xx'=>10)));
|
||||
|
||||
|
||||
+10
@@ -194,3 +194,13 @@ class problematic_event3 extends \core\event\base {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class noname_event extends \core\event\base {
|
||||
|
||||
protected function init() {
|
||||
$this->data['crud'] = 'c';
|
||||
$this->data['level'] = 10;
|
||||
$this->context = \context_system::instance();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user