Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
6baabaf7
Commit
6baabaf7
authored
Jul 17, 2020
by
Jake Dallimore
Browse files
MDL-69319 mod_lti: remove unused vars from externallib_test
parent
fb0b9f8c
Changes
1
Show whitespace changes
Inline
Side-by-side
mod/lti/tests/externallib_test.php
View file @
6baabaf7
...
@@ -92,7 +92,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
...
@@ -92,7 +92,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
* Test view_lti
* Test view_lti
*/
*/
public
function
test_get_tool_launch_data
()
{
public
function
test_get_tool_launch_data
()
{
global
$USER
,
$SITE
;
global
$USER
;
[
[
'course'
=>
$course
,
'course'
=>
$course
,
...
@@ -128,8 +128,6 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
...
@@ -128,8 +128,6 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
* Test get ltis by courses
* Test get ltis by courses
*/
*/
public
function
test_mod_lti_get_ltis_by_courses
()
{
public
function
test_mod_lti_get_ltis_by_courses
()
{
global
$DB
;
[
[
'course'
=>
$course
,
'course'
=>
$course
,
'lti'
=>
$lti
,
'lti'
=>
$lti
,
...
@@ -261,8 +259,6 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
...
@@ -261,8 +259,6 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
* Test view_lti
* Test view_lti
*/
*/
public
function
test_view_lti
()
{
public
function
test_view_lti
()
{
global
$DB
;
[
[
'lti'
=>
$lti
,
'lti'
=>
$lti
,
'context'
=>
$context
,
'context'
=>
$context
,
...
@@ -296,7 +292,8 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
...
@@ -296,7 +292,8 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
$sink
=
$this
->
redirectEvents
();
$sink
=
$this
->
redirectEvents
();
$result
=
mod_lti_external
::
view_lti
(
$lti
->
id
);
$result
=
mod_lti_external
::
view_lti
(
$lti
->
id
);
$result
=
external_api
::
clean_returnvalue
(
mod_lti_external
::
view_lti_returns
(),
$result
);
// The value of the result isn't needed but validation is.
external_api
::
clean_returnvalue
(
mod_lti_external
::
view_lti_returns
(),
$result
);
$events
=
$sink
->
get_events
();
$events
=
$sink
->
get_events
();
$this
->
assertCount
(
1
,
$events
);
$this
->
assertCount
(
1
,
$events
);
...
@@ -347,8 +344,8 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
...
@@ -347,8 +344,8 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
public
function
test_mod_lti_create_tool_proxy_duplicateurl
()
{
public
function
test_mod_lti_create_tool_proxy_duplicateurl
()
{
$this
->
setAdminUser
();
$this
->
setAdminUser
();
$this
->
expectException
(
'moodle_exception'
);
$this
->
expectException
(
'moodle_exception'
);
$proxy
=
mod_lti_external
::
create_tool_proxy
(
'Test proxy 1'
,
$this
->
getExternalTestFileUrl
(
'/test.html'
),
array
(),
array
());
mod_lti_external
::
create_tool_proxy
(
'Test proxy 1'
,
$this
->
getExternalTestFileUrl
(
'/test.html'
),
array
(),
array
());
$proxy
=
mod_lti_external
::
create_tool_proxy
(
'Test proxy 2'
,
$this
->
getExternalTestFileUrl
(
'/test.html'
),
array
(),
array
());
mod_lti_external
::
create_tool_proxy
(
'Test proxy 2'
,
$this
->
getExternalTestFileUrl
(
'/test.html'
),
array
(),
array
());
}
}
/*
/*
...
@@ -359,7 +356,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
...
@@ -359,7 +356,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
$teacher
=
$this
->
getDataGenerator
()
->
create_and_enrol
(
$course
,
'editingteacher'
);
$teacher
=
$this
->
getDataGenerator
()
->
create_and_enrol
(
$course
,
'editingteacher'
);
$this
->
setUser
(
$teacher
);
$this
->
setUser
(
$teacher
);
$this
->
expectException
(
'required_capability_exception'
);
$this
->
expectException
(
'required_capability_exception'
);
$proxy
=
mod_lti_external
::
create_tool_proxy
(
'Test proxy'
,
$this
->
getExternalTestFileUrl
(
'/test.html'
),
array
(),
array
());
mod_lti_external
::
create_tool_proxy
(
'Test proxy'
,
$this
->
getExternalTestFileUrl
(
'/test.html'
),
array
(),
array
());
}
}
/*
/*
...
@@ -413,7 +410,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
...
@@ -413,7 +410,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
$type
->
description
=
"Example description"
;
$type
->
description
=
"Example description"
;
$type
->
toolproxyid
=
$proxy
->
id
;
$type
->
toolproxyid
=
$proxy
->
id
;
$type
->
baseurl
=
$this
->
getExternalTestFileUrl
(
'/test.html'
);
$type
->
baseurl
=
$this
->
getExternalTestFileUrl
(
'/test.html'
);
$typeid
=
lti_add_type
(
$type
,
$data
);
lti_add_type
(
$type
,
$data
);
$types
=
mod_lti_external
::
get_tool_types
(
$proxy
->
id
);
$types
=
mod_lti_external
::
get_tool_types
(
$proxy
->
id
);
$types
=
external_api
::
clean_returnvalue
(
mod_lti_external
::
get_tool_types_returns
(),
$types
);
$types
=
external_api
::
clean_returnvalue
(
mod_lti_external
::
get_tool_types_returns
(),
$types
);
...
@@ -449,7 +446,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
...
@@ -449,7 +446,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
*/
*/
public
function
test_mod_lti_create_tool_type_nonexistant_file
()
{
public
function
test_mod_lti_create_tool_type_nonexistant_file
()
{
$this
->
expectException
(
'moodle_exception'
);
$this
->
expectException
(
'moodle_exception'
);
$type
=
mod_lti_external
::
create_tool_type
(
$this
->
getExternalTestFileUrl
(
'/doesntexist.xml'
),
''
,
''
);
mod_lti_external
::
create_tool_type
(
$this
->
getExternalTestFileUrl
(
'/doesntexist.xml'
),
''
,
''
);
}
}
/*
/*
...
@@ -457,7 +454,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
...
@@ -457,7 +454,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
*/
*/
public
function
test_mod_lti_create_tool_type_bad_file
()
{
public
function
test_mod_lti_create_tool_type_bad_file
()
{
$this
->
expectException
(
'moodle_exception'
);
$this
->
expectException
(
'moodle_exception'
);
$type
=
mod_lti_external
::
create_tool_type
(
$this
->
getExternalTestFileUrl
(
'/rsstest.xml'
),
''
,
''
);
mod_lti_external
::
create_tool_type
(
$this
->
getExternalTestFileUrl
(
'/rsstest.xml'
),
''
,
''
);
}
}
/*
/*
...
@@ -468,7 +465,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
...
@@ -468,7 +465,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
$teacher
=
$this
->
getDataGenerator
()
->
create_and_enrol
(
$course
,
'editingteacher'
);
$teacher
=
$this
->
getDataGenerator
()
->
create_and_enrol
(
$course
,
'editingteacher'
);
$this
->
setUser
(
$teacher
);
$this
->
setUser
(
$teacher
);
$this
->
expectException
(
'required_capability_exception'
);
$this
->
expectException
(
'required_capability_exception'
);
$type
=
mod_lti_external
::
create_tool_type
(
$this
->
getExternalTestFileUrl
(
'/ims_cartridge_basic_lti_link.xml'
),
''
,
''
);
mod_lti_external
::
create_tool_type
(
$this
->
getExternalTestFileUrl
(
'/ims_cartridge_basic_lti_link.xml'
),
''
,
''
);
}
}
/*
/*
...
@@ -513,7 +510,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
...
@@ -513,7 +510,7 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
$course
=
$this
->
getDataGenerator
()
->
create_course
();
$course
=
$this
->
getDataGenerator
()
->
create_course
();
$teacher
=
$this
->
getDataGenerator
()
->
create_and_enrol
(
$course
,
'editingteacher'
);
$teacher
=
$this
->
getDataGenerator
()
->
create_and_enrol
(
$course
,
'editingteacher'
);
$this
->
setUser
(
$teacher
);
$this
->
setUser
(
$teacher
);
$type
=
mod_lti_external
::
delete_tool_type
(
$type
[
'id'
]);
mod_lti_external
::
delete_tool_type
(
$type
[
'id'
]);
}
}
/*
/*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment