Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-qtype_stack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-qtype_stack
Commits
dd7ece12
Commit
dd7ece12
authored
6 months ago
by
Edmund Farrow
Committed by
Chris Sangwin
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
ci-again - Fix tests
parent
08d73d1c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/library_import_test.php
+4
-4
4 additions, 4 deletions
tests/library_import_test.php
tests/library_render_test.php
+3
-3
3 additions, 3 deletions
tests/library_render_test.php
with
7 additions
and
7 deletions
tests/library_import_test.php
+
4
−
4
View file @
dd7ece12
...
...
@@ -105,13 +105,13 @@ final class library_import_test extends externallib_advanced_testcase {
}
/**
* Test the library_import function fails when no
webservice export capability
assigned.
* Test the library_import function fails when no
capability to add questions
assigned.
*/
public
function
test_no_
webservice_
access
():
void
{
public
function
test_no_access
():
void
{
global
$DB
;
$context
=
context_course
::
instance
(
$this
->
course
->
id
);
$
student
roleid
=
$DB
->
get_field
(
'role'
,
'id'
,
[
'shortname'
=>
'
student
'
]);
role_assign
(
$
student
roleid
,
$this
->
user
->
id
,
$context
->
id
);
$
teacher
roleid
=
$DB
->
get_field
(
'role'
,
'id'
,
[
'shortname'
=>
'
teacher
'
]);
role_assign
(
$
teacher
roleid
,
$this
->
user
->
id
,
$context
->
id
);
$this
->
getDataGenerator
()
->
enrol_user
(
$this
->
user
->
id
,
$this
->
course
->
id
);
$this
->
expectException
(
required_capability_exception
::
class
);
$this
->
expectExceptionMessage
(
'you do not currently have permissions to do that (Add new questions).'
);
...
...
This diff is collapsed.
Click to expand it.
tests/library_render_test.php
+
3
−
3
View file @
dd7ece12
...
...
@@ -108,13 +108,13 @@ final class library_render_test extends externallib_advanced_testcase {
}
/**
* Test the library_render function fails when no
webservice export
capability assigned.
* Test the library_render function fails when no capability assigned.
*/
public
function
test_no_webservice_access
():
void
{
global
$DB
;
$context
=
context_course
::
instance
(
$this
->
course
->
id
);
$
student
roleid
=
$DB
->
get_field
(
'role'
,
'id'
,
[
'shortname'
=>
'
student
'
]);
role_assign
(
$
student
roleid
,
$this
->
user
->
id
,
$context
->
id
);
$
teacher
roleid
=
$DB
->
get_field
(
'role'
,
'id'
,
[
'shortname'
=>
'
teacher
'
]);
role_assign
(
$
teacher
roleid
,
$this
->
user
->
id
,
$context
->
id
);
$this
->
getDataGenerator
()
->
enrol_user
(
$this
->
user
->
id
,
$this
->
course
->
id
);
$this
->
expectException
(
required_capability_exception
::
class
);
$this
->
expectExceptionMessage
(
'you do not currently have permissions to do that (Add new questions).'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment