Proyectos de Subversion Moodle

Rev

Rev 11 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 1441
Línea 63... Línea 63...
63
 *
63
 *
64
 * @package    mod_lti
64
 * @package    mod_lti
65
 * @copyright  Copyright (c) 2012 Moodlerooms Inc. (http://www.moodlerooms.com)
65
 * @copyright  Copyright (c) 2012 Moodlerooms Inc. (http://www.moodlerooms.com)
66
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
66
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
67
 */
67
 */
68
class locallib_test extends mod_lti_testcase {
68
final class locallib_test extends mod_lti_testcase {
Línea 69... Línea 69...
69
 
69
 
70
    /**
70
    /**
71
     * @covers ::lti_split_parameters()
71
     * @covers ::lti_split_parameters()
72
     *
72
     *
Línea 515... Línea 515...
515
    /**
515
    /**
516
     * Provider for test_lti_get_best_tool_by_url.
516
     * Provider for test_lti_get_best_tool_by_url.
517
     *
517
     *
518
     * @return array of [urlToTest, expectedTool, allTools]
518
     * @return array of [urlToTest, expectedTool, allTools]
519
     */
519
     */
520
    public function lti_get_best_tool_by_url_provider() {
520
    public static function lti_get_best_tool_by_url_provider(): array {
521
        $tools = [
521
        $tools = [
522
            (object) [
522
            (object) [
523
                'name' => 'Here',
523
                'name' => 'Here',
524
                'baseurl' => 'https://example.com/i/am/?where=here',
524
                'baseurl' => 'https://example.com/i/am/?where=here',
525
                'tooldomain' => 'example.com',
525
                'tooldomain' => 'example.com',
Línea 603... Línea 603...
603
        ];
603
        ];
Línea 604... Línea 604...
604
 
604
 
605
        // Construct the final array as required by the provider API. Each row
605
        // Construct the final array as required by the provider API. Each row
606
        // of the array contains the URL to test, the expected tool, and
606
        // of the array contains the URL to test, the expected tool, and
607
        // the complete list of tools.
607
        // the complete list of tools.
608
        return array_map(function($data) use ($tools) {
608
        return array_map(function($data) use ($tools): array {
609
            return [$data['url'], $data['expected'], $tools];
609
            return [$data['url'], $data['expected'], $tools];
610
        }, $data);
610
        }, $data);
Línea 611... Línea 611...
611
    }
611
    }
Línea 2018... Línea 2018...
2018
    /**
2018
    /**
2019
     * Data provider for testing lti_get_ims_role.
2019
     * Data provider for testing lti_get_ims_role.
2020
     *
2020
     *
2021
     * @return array[] the test case data.
2021
     * @return array[] the test case data.
2022
     */
2022
     */
2023
    public function lti_get_ims_role_provider() {
2023
    public static function lti_get_ims_role_provider(): array {
2024
        return [
2024
        return [
2025
            'Student, LTI 1.1, no role switch' => [
2025
            'Student, LTI 1.1, no role switch' => [
2026
                'islti2' => false,
2026
                'islti2' => false,
2027
                'rolename' => 'student',
2027
                'rolename' => 'student',
2028
                'switchedto' => null,
2028
                'switchedto' => null,