| Línea 22... |
Línea 22... |
| 22 |
* @package enrol_lti
|
22 |
* @package enrol_lti
|
| 23 |
* @copyright 2021 Jake Dallimore <jrhdallimore@gmail.com>
|
23 |
* @copyright 2021 Jake Dallimore <jrhdallimore@gmail.com>
|
| 24 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
24 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 25 |
* @coversDefaultClass \enrol_lti\local\ltiadvantage\entity\resource_link
|
25 |
* @coversDefaultClass \enrol_lti\local\ltiadvantage\entity\resource_link
|
| 26 |
*/
|
26 |
*/
|
| 27 |
class resource_link_test extends \advanced_testcase {
|
27 |
final class resource_link_test extends \advanced_testcase {
|
| 28 |
/**
|
28 |
/**
|
| 29 |
* Test creation of the object instances.
|
29 |
* Test creation of the object instances.
|
| 30 |
*
|
30 |
*
|
| 31 |
* @dataProvider instantiation_data_provider
|
31 |
* @dataProvider instantiation_data_provider
|
| 32 |
* @param array $args the arguments to the creation method.
|
32 |
* @param array $args the arguments to the creation method.
|
| Línea 52... |
Línea 52... |
| 52 |
|
52 |
|
| 53 |
/**
|
53 |
/**
|
| 54 |
* Data provider for testing object instantiation.
|
54 |
* Data provider for testing object instantiation.
|
| 55 |
* @return array the data for testing.
|
55 |
* @return array the data for testing.
|
| 56 |
*/
|
56 |
*/
|
| 57 |
public function instantiation_data_provider(): array {
|
57 |
public static function instantiation_data_provider(): array {
|
| 58 |
return [
|
58 |
return [
|
| 59 |
'Valid creation, no context or id provided' => [
|
59 |
'Valid creation, no context or id provided' => [
|
| 60 |
'args' => [
|
60 |
'args' => [
|
| 61 |
'resourcelinkid' => 'res-link-id-123',
|
61 |
'resourcelinkid' => 'res-link-id-123',
|
| Línea 138... |
Línea 138... |
| 138 |
/**
|
138 |
/**
|
| 139 |
* Data provider for testing the add_grade_service method.
|
139 |
* Data provider for testing the add_grade_service method.
|
| 140 |
*
|
140 |
*
|
| 141 |
* @return array the array of test case data.
|
141 |
* @return array the array of test case data.
|
| 142 |
*/
|
142 |
*/
|
| 143 |
public function add_grade_service_provider(): array {
|
143 |
public static function add_grade_service_provider(): array {
|
| 144 |
return [
|
144 |
return [
|
| 145 |
'Valid, both URLs, some scopes' => [
|
145 |
'Valid, both URLs, some scopes' => [
|
| 146 |
'args' => [
|
146 |
'args' => [
|
| 147 |
'lineitemsurl' => new \moodle_url('https://platform.example.org/10/lineitems'),
|
147 |
'lineitemsurl' => new \moodle_url('https://platform.example.org/10/lineitems'),
|
| 148 |
'lineitemurl' => new \moodle_url('https://platform.example.org/10/lineitems/4/lineitem'),
|
148 |
'lineitemurl' => new \moodle_url('https://platform.example.org/10/lineitems/4/lineitem'),
|