MDL-75759 courseformat: Fix stateactions test
* Require lib/externallib.php in \core_courseformat\output\local\state\cm::export_for_template() * Point @coversDefaultClass to the proper class.
This commit is contained in:
@@ -18,6 +18,7 @@ namespace core_courseformat\output\local\state;
|
||||
|
||||
use core_courseformat\base as course_format;
|
||||
use completion_info;
|
||||
use renderer_base;
|
||||
use section_info;
|
||||
use cm_info;
|
||||
use renderable;
|
||||
@@ -70,8 +71,9 @@ class cm implements renderable {
|
||||
* @param renderer_base $output typically, the renderer that's calling this function
|
||||
* @return stdClass data context for a mustache template
|
||||
*/
|
||||
public function export_for_template(\renderer_base $output): stdClass {
|
||||
public function export_for_template(renderer_base $output): stdClass {
|
||||
global $USER, $CFG;
|
||||
require_once($CFG->libdir . '/externallib.php');
|
||||
|
||||
$format = $this->format;
|
||||
$section = $this->section;
|
||||
|
||||
@@ -26,7 +26,7 @@ use stdClass;
|
||||
* @category test
|
||||
* @copyright 2021 Sara Arjona ([email protected])
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @coversDefaultClass \core_course\stateactions
|
||||
* @coversDefaultClass \core_courseformat\stateactions
|
||||
*/
|
||||
class stateactions_test extends \advanced_testcase {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user