From 83a82dd0ba2001399a050561ea075cce4e0d656e Mon Sep 17 00:00:00 2001 From: eWallah Date: Thu, 1 Apr 2021 10:40:57 +0200 Subject: [PATCH] masonry renderer --- tests/format_masonry_test.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/format_masonry_test.php b/tests/format_masonry_test.php index 87058c7..4dac3aa 100644 --- a/tests/format_masonry_test.php +++ b/tests/format_masonry_test.php @@ -198,12 +198,14 @@ public function test_format() { $format = course_get_format($this->course); $this->assertEquals('masonry', $format->get_format()); $this->setAdminUser(); - $PAGE->get_renderer('core', 'course'); - $PAGE->set_context(\context_course::instance($this->course->id)); + $PAGE->set_course($this->course); + $PAGE->get_renderer('format_masonry'); + // Mimick course variable. $course = $this->course; ob_start(); include_once($CFG->dirroot . '/course/format/masonry/format.php'); ob_end_clean(); + $this->assertEquals($course, $PAGE->course); } /** @@ -216,8 +218,8 @@ public function test_format_editing() { $this->assertEquals('masonry', $format->get_format()); $this->setAdminUser(); $USER->editing = true; - $PAGE->get_renderer('core', 'course'); - $PAGE->set_context(\context_course::instance($this->course->id)); + $PAGE->set_course($this->course); + $PAGE->get_renderer('format_masonry'); sesskey(); $_POST['marker'] = 2; ob_start();