| 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_shared_drives_content_test extends \googledocs_content_testcase {
|
32 |
final class googledocs_shared_drives_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 66... |
Línea 65... |
| 66 |
/**
|
65 |
/**
|
| 67 |
* Data provider for test_get_content_nodes().
|
66 |
* Data provider for test_get_content_nodes().
|
| 68 |
*
|
67 |
*
|
| 69 |
* @return array
|
68 |
* @return array
|
| 70 |
*/
|
69 |
*/
|
| 71 |
public function get_content_nodes_provider(): array {
|
70 |
public static function get_content_nodes_provider(): array {
|
| 72 |
|
- |
|
| 73 |
$rootid = \repository_googledocs::REPOSITORY_ROOT_ID;
|
71 |
$rootid = \repository_googledocs::REPOSITORY_ROOT_ID;
|
| 74 |
$shareddrivesid = \repository_googledocs::SHARED_DRIVES_ROOT_ID;
|
72 |
$shareddrivesid = \repository_googledocs::SHARED_DRIVES_ROOT_ID;
|
| 75 |
$shareddrivesstring = get_string('shareddrives', 'repository_googledocs');
|
73 |
$shareddrivesstring = get_string('shareddrives', 'repository_googledocs');
|
| Línea 76... |
Línea 74... |
| 76 |
|
74 |
|
| 77 |
return [
|
75 |
return [
|
| 78 |
'Shared drives exist; ordering applied.' =>
|
76 |
'Shared drives exist; ordering applied.' =>
|
| 79 |
[
|
77 |
[
|
| 80 |
[
|
78 |
[
|
| 81 |
$this->create_google_drive_shared_drive_object('d85b21c0f86cb5', 'Shared Drive 1'),
|
79 |
self::create_google_drive_shared_drive_object('d85b21c0f86cb5', 'Shared Drive 1'),
|
| 82 |
$this->create_google_drive_shared_drive_object('d85b21c0f86cb0', 'Shared Drive 3'),
|
80 |
self::create_google_drive_shared_drive_object('d85b21c0f86cb0', 'Shared Drive 3'),
|
| 83 |
$this->create_google_drive_shared_drive_object('bed5a0f08d412a', 'Shared Drive 2'),
|
81 |
self::create_google_drive_shared_drive_object('bed5a0f08d412a', 'Shared Drive 2'),
|
| 84 |
],
|
82 |
],
|
| 85 |
true,
|
83 |
true,
|
| 86 |
[
|
84 |
[
|
| 87 |
$this->create_folder_content_node_array('d85b21c0f86cb5', 'Shared Drive 1',
|
85 |
self::create_folder_content_node_array('d85b21c0f86cb5', 'Shared Drive 1',
|
| 88 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
86 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
| 89 |
$this->create_folder_content_node_array('bed5a0f08d412a', 'Shared Drive 2',
|
87 |
self::create_folder_content_node_array('bed5a0f08d412a', 'Shared Drive 2',
|
| 90 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
88 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
| 91 |
$this->create_folder_content_node_array('d85b21c0f86cb0', 'Shared Drive 3',
|
89 |
self::create_folder_content_node_array('d85b21c0f86cb0', 'Shared Drive 3',
|
| 92 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
90 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
| 93 |
],
|
91 |
],
|
| 94 |
],
|
92 |
],
|
| 95 |
'Shared drives exist; ordering not applied.' =>
|
93 |
'Shared drives exist; ordering not applied.' =>
|
| 96 |
[
|
94 |
[
|
| 97 |
[
|
95 |
[
|
| 98 |
$this->create_google_drive_shared_drive_object('0c4ad262c65333', 'Shared Drive 3'),
|
96 |
self::create_google_drive_shared_drive_object('0c4ad262c65333', 'Shared Drive 3'),
|
| 99 |
$this->create_google_drive_shared_drive_object('d85b21c0f86cb0', 'Shared Drive 1'),
|
97 |
self::create_google_drive_shared_drive_object('d85b21c0f86cb0', 'Shared Drive 1'),
|
| 100 |
$this->create_google_drive_shared_drive_object('bed5a0f08d412a', 'Shared Drive 2'),
|
98 |
self::create_google_drive_shared_drive_object('bed5a0f08d412a', 'Shared Drive 2'),
|
| 101 |
],
|
99 |
],
|
| 102 |
false,
|
100 |
false,
|
| 103 |
[
|
101 |
[
|
| 104 |
$this->create_folder_content_node_array('0c4ad262c65333', 'Shared Drive 3',
|
102 |
self::create_folder_content_node_array('0c4ad262c65333', 'Shared Drive 3',
|
| 105 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
103 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
| 106 |
$this->create_folder_content_node_array('d85b21c0f86cb0', 'Shared Drive 1',
|
104 |
self::create_folder_content_node_array('d85b21c0f86cb0', 'Shared Drive 1',
|
| 107 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
105 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
| 108 |
$this->create_folder_content_node_array('bed5a0f08d412a', 'Shared Drive 2',
|
106 |
self::create_folder_content_node_array('bed5a0f08d412a', 'Shared Drive 2',
|
| 109 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
107 |
"{$rootid}|Google+Drive/{$shareddrivesid}|" . urlencode($shareddrivesstring)),
|
| 110 |
],
|
108 |
],
|
| 111 |
],
|
109 |
],
|
| 112 |
'Shared drives do not exist.' =>
|
110 |
'Shared drives do not exist.' =>
|