Skip to content

Commit

Permalink
Fix tests/csvexport_test.php.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Mar 14, 2024
1 parent 4bf5aec commit 0334a66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

namespace mod_questionnaire;

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir . '/externallib.php');

use external_api;
Expand Down
4 changes: 3 additions & 1 deletion tests/csvexport_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public function test_csvexport() {

/**
* Tests the CSV export with identity fields and anonymous questionnaires.
*
* @covers ::csvexport
*/
public function test_csvexport_identity_fields() {
global $DB;
Expand Down Expand Up @@ -147,7 +149,7 @@ private function do_test_csvexport_identity_fields($course, $cm, $user, $roleid,
assign_capability('moodle/site:viewuseridentity', CAP_ALLOW, $roleid, $context);

// Generate CSV output.
$questionnaire = new questionnaire($course, $cm, $item->id);
$questionnaire = new \questionnaire($course, $cm, $item->id);
$output = $questionnaire->generate_csv(0, '', '', 0, 0, 1);

$this->assertNotNull($output);
Expand Down

0 comments on commit 0334a66

Please sign in to comment.