Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 27... Línea 27...
27
 *
27
 *
28
 * @package    repository_googledocs
28
 * @package    repository_googledocs
29
 * @copyright  2021 Mihail Geshoski <mihail@moodle.com>
29
 * @copyright  2021 Mihail Geshoski <mihail@moodle.com>
30
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
30
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
31
 */
31
 */
32
class googledocs_root_content_test extends \googledocs_content_testcase {
32
final class googledocs_root_content_test extends \googledocs_content_testcase {
33
 
-
 
34
    /**
33
    /**
35
     * Test get_content_nodes().
34
     * Test get_content_nodes().
36
     *
35
     *
37
     * @dataProvider get_content_nodes_provider
36
     * @dataProvider get_content_nodes_provider
38
     * @param array $shareddrives The array containing the existing shared drives
37
     * @param array $shareddrives The array containing the existing shared drives
Línea 64... Línea 63...
64
    /**
63
    /**
65
     * Data provider for test_get_content_nodes().
64
     * Data provider for test_get_content_nodes().
66
     *
65
     *
67
     * @return array
66
     * @return array
68
     */
67
     */
69
    public function get_content_nodes_provider(): array {
68
    public static function get_content_nodes_provider(): array {
70
 
-
 
71
        $rootid = \repository_googledocs::REPOSITORY_ROOT_ID;
69
        $rootid = \repository_googledocs::REPOSITORY_ROOT_ID;
72
        $mydriveid = \repository_googledocs::MY_DRIVE_ROOT_ID;
70
        $mydriveid = \repository_googledocs::MY_DRIVE_ROOT_ID;
73
        $shareddrivesid = \repository_googledocs::SHARED_DRIVES_ROOT_ID;
71
        $shareddrivesid = \repository_googledocs::SHARED_DRIVES_ROOT_ID;
Línea 74... Línea 72...
74
 
72
 
75
        return [
73
        return [
-
 
74
            'Shared drives exist.' => [
-
 
75
                [
-
 
76
                    self::create_google_drive_shared_drive_object('d85b21c0f86cb5', 'Shared Drive 1'),
-
 
77
                    self::create_google_drive_shared_drive_object('d85b21c0f86cb0', 'Shared Drive 3'),
76
            'Shared drives exist.' =>
78
                ],
77
                [
-
 
78
                    [
-
 
79
                        $this->create_google_drive_shared_drive_object('d85b21c0f86cb5', 'Shared Drive 1'),
-
 
80
                        $this->create_google_drive_shared_drive_object('d85b21c0f86cb0', 'Shared Drive 3'),
-
 
81
                    ],
-
 
82
                    [
79
                [
83
                        $this->create_folder_content_node_array($mydriveid,
80
                    self::create_folder_content_node_array($mydriveid,
84
                            get_string('mydrive', 'repository_googledocs'),
81
                        get_string('mydrive', 'repository_googledocs'),
85
                            "{$rootid}|Google+Drive"),
82
                        "{$rootid}|Google+Drive"),
86
                        $this->create_folder_content_node_array($shareddrivesid,
83
                    self::create_folder_content_node_array($shareddrivesid,
87
                            get_string('shareddrives', 'repository_googledocs'),
84
                        get_string('shareddrives', 'repository_googledocs'),
88
                            "{$rootid}|Google+Drive"),
-
 
89
                    ],
85
                        "{$rootid}|Google+Drive"),
-
 
86
                ],
90
                ],
87
            ],
-
 
88
            'Shared drives do not exist.' => [
91
            'Shared drives do not exist.' =>
89
                [],
92
                [
-
 
93
                    [],
-
 
94
                    [
90
                [
95
                        $this->create_folder_content_node_array($mydriveid,
91
                    self::create_folder_content_node_array($mydriveid,
96
                            get_string('mydrive', 'repository_googledocs'),
92
                        get_string('mydrive', 'repository_googledocs'),
97
                            "{$rootid}|Google+Drive"),
-
 
98
                    ],
93
                        "{$rootid}|Google+Drive"),
-
 
94
                ],
99
                ],
95
            ],
100
        ];
96
        ];
101
    }
97
    }