public function test_get_activity_name() { // Setup fixture. $course = $this->getDataGenerator()->create_course(); $forum = $this->getDataGenerator()->create_module('forum', array('course' => $course->id)); $cm = get_coursemodule_from_id('forum', $forum->cmid); // Exercise SUT. $this->testpage->set_cm($cm, $course, $forum); // Validated. $this->assertSame('forum', $this->testpage->activityname); }