Skip to content

Commit

Permalink
MDL-75759 courseformat: Fix stateactions test
Browse files Browse the repository at this point in the history
* Require lib/externallib.php in
\core_courseformat\output\local\state\cm::export_for_template()
* Point @coversDefaultClass to the proper class.
  • Loading branch information
junpataleta committed Nov 3, 2022
1 parent 35f39c4 commit dbf67c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion course/format/classes/output/local/state/cm.php
Expand Up @@ -18,6 +18,7 @@

use core_courseformat\base as course_format;
use completion_info;
use renderer_base;
use section_info;
use cm_info;
use renderable;
Expand Down Expand Up @@ -70,8 +71,9 @@ public function __construct(course_format $format, section_info $section, cm_inf
* @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;
Expand Down
2 changes: 1 addition & 1 deletion course/format/tests/stateactions_test.php
Expand Up @@ -26,7 +26,7 @@
* @category test
* @copyright 2021 Sara Arjona (sara@moodle.com)
* @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 {

Expand Down

0 comments on commit dbf67c0

Please sign in to comment.