moodle_rb 1.0.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/build.yml +36 -0
  3. data/.github/workflows/publish.yml +27 -0
  4. data/Dockerfile +10 -0
  5. data/README.md +73 -1
  6. data/docker-compose.yml +6 -0
  7. data/lib/moodle_rb/categories.rb +12 -11
  8. data/lib/moodle_rb/client.rb +10 -8
  9. data/lib/moodle_rb/courses.rb +59 -13
  10. data/lib/moodle_rb/enrolments.rb +34 -9
  11. data/lib/moodle_rb/grades.rb +9 -14
  12. data/lib/moodle_rb/users.rb +35 -19
  13. data/lib/moodle_rb/utility.rb +7 -0
  14. data/lib/moodle_rb/version.rb +1 -1
  15. data/lib/moodle_rb.rb +2 -2
  16. data/moodle_rb.gemspec +2 -3
  17. data/spec/cassettes/MoodleRb_Categories/_create/.yml +19 -19
  18. data/spec/cassettes/MoodleRb_Categories/_create/when_validation_fails/.yml +19 -19
  19. data/spec/cassettes/MoodleRb_Categories/_destroy/when_using_invalid_token/.yml +39 -0
  20. data/spec/cassettes/MoodleRb_Categories/_destroy/when_using_valid_token/.yml +76 -0
  21. data/spec/cassettes/MoodleRb_Categories/_index/.yml +19 -19
  22. data/spec/cassettes/MoodleRb_Categories/_index/when_using_invalid_token/.yml +39 -0
  23. data/spec/cassettes/MoodleRb_Categories/_show/when_using_invalid_token/.yml +39 -0
  24. data/spec/cassettes/MoodleRb_Client/_site_info/when_invalid_token/.yml +20 -20
  25. data/spec/cassettes/MoodleRb_Client/_site_info/when_valid_token/.yml +19 -19
  26. data/spec/cassettes/MoodleRb_Courses/_contents/when_using_invalid_token/.yml +52 -0
  27. data/spec/cassettes/MoodleRb_Courses/_contents/when_using_valid_token/.yml +52 -0
  28. data/spec/cassettes/MoodleRb_Courses/_create/.yml +19 -19
  29. data/spec/cassettes/MoodleRb_Courses/_create/when_validation_fails/.yml +36 -36
  30. data/spec/cassettes/MoodleRb_Courses/_destroy/when_using_invalid_token/.yml +39 -0
  31. data/spec/cassettes/MoodleRb_Courses/_destroy/when_using_valid_token/.yml +75 -0
  32. data/spec/cassettes/MoodleRb_Courses/_destroy/when_using_valid_token/when_using_invalid_course_id/.yml +39 -0
  33. data/spec/cassettes/MoodleRb_Courses/_enrolled_users/when_using_invalid_token/.yml +39 -0
  34. data/spec/cassettes/MoodleRb_Courses/_enrolled_users/when_using_valid_token/.yml +75 -0
  35. data/spec/cassettes/MoodleRb_Courses/_grade_items/when_using_invalid_token/.yml +52 -0
  36. data/spec/cassettes/MoodleRb_Courses/_grade_items/when_using_valid_token/.yml +56 -0
  37. data/spec/cassettes/MoodleRb_Courses/_index/.yml +19 -19
  38. data/spec/cassettes/MoodleRb_Courses/_index/when_using_invalid_token/.yml +39 -0
  39. data/spec/cassettes/MoodleRb_Courses/_module/when_using_invalid_token/.yml +52 -0
  40. data/spec/cassettes/MoodleRb_Courses/_module/when_using_valid_token/.yml +51 -0
  41. data/spec/cassettes/MoodleRb_Courses/_show/.yml +19 -19
  42. data/spec/cassettes/MoodleRb_Courses/_show/when_using_invalid_token/.yml +39 -0
  43. data/spec/cassettes/MoodleRb_Enrolments/_create/.yml +19 -19
  44. data/spec/cassettes/MoodleRb_Enrolments/_create/when_user_or_course_id_is_invalid/.yml +19 -19
  45. data/spec/cassettes/MoodleRb_Enrolments/_destroy/.yml +51 -0
  46. data/spec/cassettes/MoodleRb_Enrolments/_destroy/when_user_or_course_id_is_invalid/.yml +52 -0
  47. data/spec/cassettes/MoodleRb_Grades/_by_assignment/.yml +19 -19
  48. data/spec/cassettes/MoodleRb_Grades/_by_course/.yml +19 -19
  49. data/spec/cassettes/MoodleRb_Grades/_by_course/when_invalid_parameters/.yml +19 -19
  50. data/spec/cassettes/MoodleRb_Users/_create/.yml +19 -19
  51. data/spec/cassettes/MoodleRb_Users/_create/when_missing_required_parameters/.yml +19 -19
  52. data/spec/cassettes/MoodleRb_Users/_destroy/.yml +19 -19
  53. data/spec/cassettes/MoodleRb_Users/_destroy/when_id_does_not_exist/.yml +19 -19
  54. data/spec/cassettes/MoodleRb_Users/_destroy/when_using_invalid_token/.yml +39 -0
  55. data/spec/cassettes/MoodleRb_Users/_enrolled_courses/.yml +19 -19
  56. data/spec/cassettes/MoodleRb_Users/_enrolled_courses/when_using_invalid_token/.yml +39 -0
  57. data/spec/cassettes/MoodleRb_Users/_search/.yml +21 -21
  58. data/spec/cassettes/MoodleRb_Users/_search/when_using_invalid_token/.yml +39 -0
  59. data/spec/cassettes/MoodleRb_Users/_search_identity/.yml +51 -0
  60. data/spec/cassettes/MoodleRb_Users/_search_identity/when_using_invalid_token/.yml +52 -0
  61. data/spec/cassettes/MoodleRb_Users/_show/.yml +19 -19
  62. data/spec/cassettes/MoodleRb_Users/_show/when_using_invalid_token/.yml +39 -0
  63. data/spec/cassettes/MoodleRb_Users/_update/.yml +20 -20
  64. data/spec/cassettes/MoodleRb_Users/_update/when_using_invalid_token/.yml +39 -0
  65. data/spec/lib/moodle_rb/categories_spec.rb +42 -10
  66. data/spec/lib/moodle_rb/client_spec.rb +7 -5
  67. data/spec/lib/moodle_rb/courses_spec.rb +155 -20
  68. data/spec/lib/moodle_rb/enrolments_spec.rb +36 -3
  69. data/spec/lib/moodle_rb/grades_spec.rb +4 -4
  70. data/spec/lib/moodle_rb/users_spec.rb +93 -9
  71. data/spec/lib/moodle_rb_spec.rb +2 -2
  72. metadata +150 -142
  73. data/spec/cassettes/MoodleRb_Categories/_destroy/.yml +0 -75
  74. data/spec/cassettes/MoodleRb_Courses/_destroy/.yml +0 -75
  75. data/spec/cassettes/MoodleRb_Courses/_enrolled_users/.yml +0 -75
@@ -1,39 +1,39 @@
1
- ---
2
- http_interactions:
3
- - request:
1
+ ---
2
+ http_interactions:
3
+ - request:
4
4
  method: post
5
5
  uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_user_create_users&wstoken=60fc9c9415259404795094957e4ab32f
6
- body:
6
+ body:
7
7
  string: users[0][username]=testuser1
8
8
  headers: {}
9
9
 
10
- response:
11
- status:
10
+ response:
11
+ status:
12
12
  code: 200
13
13
  message: OK
14
- headers:
15
- Cache-Control:
14
+ headers:
15
+ Cache-Control:
16
16
  - private, must-revalidate, pre-check=0, post-check=0, max-age=0
17
- X-Powered-By:
17
+ X-Powered-By:
18
18
  - PHP/5.6.2
19
- Pragma:
19
+ Pragma:
20
20
  - no-cache
21
- Content-Length:
21
+ Content-Length:
22
22
  - "119"
23
- Server:
23
+ Server:
24
24
  - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_perl/2.0.8 Perl/v5.20.0
25
- Access-Control-Allow-Origin:
25
+ Access-Control-Allow-Origin:
26
26
  - "*"
27
- Accept-Ranges:
27
+ Accept-Ranges:
28
28
  - none
29
- Content-Type:
29
+ Content-Type:
30
30
  - application/json
31
- Expires:
31
+ Expires:
32
32
  - Thu, 01 Jan 1970 00:00:00 GMT
33
- Date:
33
+ Date:
34
34
  - Sun, 12 Apr 2015 01:01:16 GMT
35
- body:
35
+ body:
36
36
  string: "{\"exception\":\"invalid_parameter_exception\",\"errorcode\":\"invalidparameter\",\"message\":\"Invalid parameter value detected\"}"
37
- http_version:
37
+ http_version:
38
38
  recorded_at: Sun, 12 Apr 2015 01:01:16 GMT
39
39
  recorded_with: VCR 2.9.3
@@ -1,39 +1,39 @@
1
- ---
1
+ ---
2
2
  recorded_with: VCR 2.9.3
3
- http_interactions:
4
- - request:
3
+ http_interactions:
4
+ - request:
5
5
  method: post
6
6
  uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_user_delete_users&wstoken=60fc9c9415259404795094957e4ab32f
7
- body:
7
+ body:
8
8
  string: userids[0]=5
9
9
  headers: {}
10
10
 
11
- response:
12
- status:
11
+ response:
12
+ status:
13
13
  code: 200
14
14
  message: OK
15
- headers:
16
- Access-Control-Allow-Origin:
15
+ headers:
16
+ Access-Control-Allow-Origin:
17
17
  - "*"
18
- Content-Type:
18
+ Content-Type:
19
19
  - application/json
20
- Date:
20
+ Date:
21
21
  - Sun, 12 Apr 2015 01:04:36 GMT
22
- Content-Length:
22
+ Content-Length:
23
23
  - "4"
24
- X-Powered-By:
24
+ X-Powered-By:
25
25
  - PHP/5.6.2
26
- Accept-Ranges:
26
+ Accept-Ranges:
27
27
  - none
28
- Expires:
28
+ Expires:
29
29
  - Thu, 01 Jan 1970 00:00:00 GMT
30
- Server:
30
+ Server:
31
31
  - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_perl/2.0.8 Perl/v5.20.0
32
- Pragma:
32
+ Pragma:
33
33
  - no-cache
34
- Cache-Control:
34
+ Cache-Control:
35
35
  - private, must-revalidate, pre-check=0, post-check=0, max-age=0
36
- body:
36
+ body:
37
37
  string: "null"
38
- http_version:
38
+ http_version:
39
39
  recorded_at: Sun, 12 Apr 2015 01:04:36 GMT
@@ -1,39 +1,39 @@
1
- ---
2
- http_interactions:
3
- - request:
1
+ ---
2
+ http_interactions:
3
+ - request:
4
4
  method: post
5
5
  uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_user_delete_users&wstoken=60fc9c9415259404795094957e4ab32f
6
- body:
6
+ body:
7
7
  string: userids[0]=999
8
8
  headers: {}
9
9
 
10
- response:
11
- status:
10
+ response:
11
+ status:
12
12
  code: 200
13
13
  message: OK
14
- headers:
15
- Cache-Control:
14
+ headers:
15
+ Cache-Control:
16
16
  - private, must-revalidate, pre-check=0, post-check=0, max-age=0
17
- Content-Type:
17
+ Content-Type:
18
18
  - application/json
19
- Access-Control-Allow-Origin:
19
+ Access-Control-Allow-Origin:
20
20
  - "*"
21
- Pragma:
21
+ Pragma:
22
22
  - no-cache
23
- Expires:
23
+ Expires:
24
24
  - Thu, 01 Jan 1970 00:00:00 GMT
25
- Accept-Ranges:
25
+ Accept-Ranges:
26
26
  - none
27
- Server:
27
+ Server:
28
28
  - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_perl/2.0.8 Perl/v5.20.0
29
- X-Powered-By:
29
+ X-Powered-By:
30
30
  - PHP/5.6.2
31
- Date:
31
+ Date:
32
32
  - Sun, 12 Apr 2015 01:03:59 GMT
33
- Content-Length:
33
+ Content-Length:
34
34
  - "95"
35
- body:
35
+ body:
36
36
  string: "{\"exception\":\"dml_missing_record_exception\",\"errorcode\":\"invaliduser\",\"message\":\"Invalid user\"}"
37
- http_version:
37
+ http_version:
38
38
  recorded_at: Sun, 12 Apr 2015 01:03:59 GMT
39
39
  recorded_with: VCR 2.9.3
@@ -0,0 +1,39 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_user_delete_users&wstoken=
6
+ body:
7
+ string: userids[0]=-1
8
+ headers: {}
9
+
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Pragma:
16
+ - no-cache
17
+ Date:
18
+ - Mon, 20 Jun 2016 22:34:35 GMT
19
+ Content-Length:
20
+ - "103"
21
+ Accept-Ranges:
22
+ - none
23
+ Content-Type:
24
+ - application/json
25
+ Access-Control-Allow-Origin:
26
+ - "*"
27
+ X-Powered-By:
28
+ - PHP/5.6.2
29
+ Expires:
30
+ - Thu, 01 Jan 1970 00:00:00 GMT
31
+ Server:
32
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
33
+ Cache-Control:
34
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
35
+ body:
36
+ string: "{\"exception\":\"moodle_exception\",\"errorcode\":\"invalidtoken\",\"message\":\"Invalid token - token not found\"}"
37
+ http_version:
38
+ recorded_at: Mon, 20 Jun 2016 22:34:35 GMT
39
+ recorded_with: VCR 2.9.3
@@ -1,39 +1,39 @@
1
- ---
1
+ ---
2
2
  recorded_with: VCR 2.9.3
3
- http_interactions:
4
- - request:
3
+ http_interactions:
4
+ - request:
5
5
  method: post
6
6
  uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_enrol_get_users_courses&wstoken=60fc9c9415259404795094957e4ab32f
7
- body:
7
+ body:
8
8
  string: userid=3
9
9
  headers: {}
10
10
 
11
- response:
12
- status:
11
+ response:
12
+ status:
13
13
  code: 200
14
14
  message: OK
15
- headers:
16
- Accept-Ranges:
15
+ headers:
16
+ Accept-Ranges:
17
17
  - none
18
- Date:
18
+ Date:
19
19
  - Sun, 12 Apr 2015 01:05:25 GMT
20
- Cache-Control:
20
+ Cache-Control:
21
21
  - private, must-revalidate, pre-check=0, post-check=0, max-age=0
22
- Expires:
22
+ Expires:
23
23
  - Thu, 01 Jan 1970 00:00:00 GMT
24
- Pragma:
24
+ Pragma:
25
25
  - no-cache
26
- X-Powered-By:
26
+ X-Powered-By:
27
27
  - PHP/5.6.2
28
- Content-Type:
28
+ Content-Type:
29
29
  - application/json
30
- Server:
30
+ Server:
31
31
  - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_perl/2.0.8 Perl/v5.20.0
32
- Content-Length:
32
+ Content-Length:
33
33
  - "110"
34
- Access-Control-Allow-Origin:
34
+ Access-Control-Allow-Origin:
35
35
  - "*"
36
- body:
36
+ body:
37
37
  string: "[{\"id\":8,\"shortname\":\"TestC1\",\"fullname\":\"Test Course\",\"enrolledusercount\":1,\"idnumber\":\"ExtRef\",\"visible\":1}]"
38
- http_version:
38
+ http_version:
39
39
  recorded_at: Sun, 12 Apr 2015 01:05:25 GMT
@@ -0,0 +1,39 @@
1
+ ---
2
+ recorded_with: VCR 2.9.3
3
+ http_interactions:
4
+ - request:
5
+ method: post
6
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_enrol_get_users_courses&wstoken=
7
+ body:
8
+ string: userid=3
9
+ headers: {}
10
+
11
+ response:
12
+ status:
13
+ code: 200
14
+ message: OK
15
+ headers:
16
+ Server:
17
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
18
+ Expires:
19
+ - Thu, 01 Jan 1970 00:00:00 GMT
20
+ Content-Length:
21
+ - "103"
22
+ Pragma:
23
+ - no-cache
24
+ Cache-Control:
25
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
26
+ Accept-Ranges:
27
+ - none
28
+ Content-Type:
29
+ - application/json
30
+ X-Powered-By:
31
+ - PHP/5.6.2
32
+ Access-Control-Allow-Origin:
33
+ - "*"
34
+ Date:
35
+ - Mon, 20 Jun 2016 22:37:07 GMT
36
+ body:
37
+ string: "{\"exception\":\"moodle_exception\",\"errorcode\":\"invalidtoken\",\"message\":\"Invalid token - token not found\"}"
38
+ http_version:
39
+ recorded_at: Mon, 20 Jun 2016 22:37:07 GMT
@@ -1,39 +1,39 @@
1
- ---
2
- http_interactions:
3
- - request:
1
+ ---
2
+ http_interactions:
3
+ - request:
4
4
  method: post
5
- uri: http://localhost:8888/moodle29/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_user_get_users&wstoken=87b95af2df709fa60b395b5c59a3fc2e
6
- body:
5
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_user_get_users&wstoken=60fc9c9415259404795094957e4ab32f
6
+ body:
7
7
  string: criteria[0][value]=Guest%25&criteria[0][key]=firstname
8
8
  headers: {}
9
9
 
10
- response:
11
- status:
10
+ response:
11
+ status:
12
12
  code: 200
13
13
  message: OK
14
- headers:
15
- Date:
14
+ headers:
15
+ Date:
16
16
  - Wed, 08 Jun 2016 06:25:46 GMT
17
- Expires:
17
+ Expires:
18
18
  - Thu, 01 Jan 1970 00:00:00 GMT
19
- Pragma:
19
+ Pragma:
20
20
  - no-cache
21
- X-Powered-By:
21
+ X-Powered-By:
22
22
  - PHP/5.6.2
23
- Server:
23
+ Server:
24
24
  - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
25
- Content-Type:
25
+ Content-Type:
26
26
  - application/json
27
- Access-Control-Allow-Origin:
27
+ Access-Control-Allow-Origin:
28
28
  - "*"
29
- Content-Length:
29
+ Content-Length:
30
30
  - "339"
31
- Accept-Ranges:
31
+ Accept-Ranges:
32
32
  - none
33
- Cache-Control:
33
+ Cache-Control:
34
34
  - private, must-revalidate, pre-check=0, post-check=0, max-age=0
35
- body:
36
- string: "{\"users\":[{\"id\":1,\"firstname\":\"Guest user\",\"lastname\":\" \",\"fullname\":\"Guest user \",\"email\":\"root@localhost\",\"firstaccess\":0,\"lastaccess\":0,\"profileimageurlsmall\":\"http:\\/\\/localhost:8888\\/moodle29\\/pluginfile.php\\/4\\/user\\/icon\\/f2\",\"profileimageurl\":\"http:\\/\\/localhost:8888\\/moodle29\\/pluginfile.php\\/4\\/user\\/icon\\/f1\"}],\"warnings\":[]}"
37
- http_version:
35
+ body:
36
+ string: "{\"users\":[{\"id\":1,\"firstname\":\"Guest user\",\"lastname\":\" \",\"fullname\":\"Guest user \",\"email\":\"root@localhost\",\"firstaccess\":0,\"lastaccess\":0,\"profileimageurlsmall\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/4\\/user\\/icon\\/f2\",\"profileimageurl\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/4\\/user\\/icon\\/f1\"}],\"warnings\":[]}"
37
+ http_version:
38
38
  recorded_at: Wed, 08 Jun 2016 06:25:46 GMT
39
39
  recorded_with: VCR 2.9.3
@@ -0,0 +1,39 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_user_get_users&wstoken=
6
+ body:
7
+ string: criteria[0][value]=%25&criteria[0][key]=firstname
8
+ headers: {}
9
+
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Content-Length:
16
+ - "103"
17
+ Expires:
18
+ - Thu, 01 Jan 1970 00:00:00 GMT
19
+ Accept-Ranges:
20
+ - none
21
+ X-Powered-By:
22
+ - PHP/5.6.2
23
+ Content-Type:
24
+ - application/json
25
+ Date:
26
+ - Mon, 20 Jun 2016 22:38:27 GMT
27
+ Access-Control-Allow-Origin:
28
+ - "*"
29
+ Cache-Control:
30
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
31
+ Server:
32
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
33
+ Pragma:
34
+ - no-cache
35
+ body:
36
+ string: "{\"exception\":\"moodle_exception\",\"errorcode\":\"invalidtoken\",\"message\":\"Invalid token - token not found\"}"
37
+ http_version:
38
+ recorded_at: Mon, 20 Jun 2016 22:38:27 GMT
39
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_user_search_identity&wstoken=60fc9c9415259404795094957e4ab32f
6
+ body:
7
+ encoding: UTF-8
8
+ string: query=moodle_student%40mailinator.com
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Accept-Ranges:
16
+ - bytes
17
+ - none
18
+ Access-Control-Allow-Origin:
19
+ - "*"
20
+ Age:
21
+ - '0'
22
+ Cache-Control:
23
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
24
+ Content-Type:
25
+ - application/json
26
+ Date:
27
+ - Tue, 11 Jan 2022 21:28:57 GMT
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Pragma:
31
+ - no-cache
32
+ Server:
33
+ - Moodle
34
+ X-Cache:
35
+ - MISS
36
+ X-Clacks-Overhead:
37
+ - GNU Terry Pratchett
38
+ X-Ec2-Instance-Id:
39
+ - i-08adafc8cf93e6451
40
+ X-Powered-By:
41
+ - Moodle Ninjas
42
+ Content-Length:
43
+ - '195'
44
+ Connection:
45
+ - keep-alive
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"list":[{"id":25,"fullname":"Moodle Student","extrafields":[{"name":"idnumber","value":"MS01"},{"name":"email","value":"moodle_student@mailinator.com"}]}],"maxusersperpage":100,"overflow":false}'
49
+ http_version:
50
+ recorded_at: Tue, 11 Jan 2022 21:28:24 GMT
51
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_user_search_identity&wstoken=
6
+ body:
7
+ encoding: UTF-8
8
+ string: query=moodle_student%40mailinator.com
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Accept-Ranges:
16
+ - bytes
17
+ - none
18
+ Access-Control-Allow-Origin:
19
+ - "*"
20
+ Age:
21
+ - '0'
22
+ Cache-Control:
23
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
24
+ Content-Type:
25
+ - application/json
26
+ Date:
27
+ - Tue, 11 Jan 2022 21:28:57 GMT
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Pragma:
31
+ - no-cache
32
+ Server:
33
+ - Moodle
34
+ X-Cache:
35
+ - MISS
36
+ X-Clacks-Overhead:
37
+ - GNU Terry Pratchett
38
+ X-Ec2-Instance-Id:
39
+ - i-0afd4744d7a60c5d7
40
+ X-Powered-By:
41
+ - Moodle Ninjas
42
+ Content-Length:
43
+ - '103'
44
+ Connection:
45
+ - keep-alive
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"exception":"moodle_exception","errorcode":"invalidtoken","message":"Invalid
49
+ token - token not found"}'
50
+ http_version:
51
+ recorded_at: Tue, 11 Jan 2022 21:28:24 GMT
52
+ recorded_with: VCR 2.9.3
@@ -1,39 +1,39 @@
1
- ---
1
+ ---
2
2
  recorded_with: VCR 2.9.3
3
- http_interactions:
4
- - request:
3
+ http_interactions:
4
+ - request:
5
5
  method: post
6
6
  uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_user_get_users&wstoken=60fc9c9415259404795094957e4ab32f
7
- body:
7
+ body:
8
8
  string: criteria[0][key]=id&criteria[0][value]=5
9
9
  headers: {}
10
10
 
11
- response:
12
- status:
11
+ response:
12
+ status:
13
13
  code: 200
14
14
  message: OK
15
- headers:
16
- Server:
15
+ headers:
16
+ Server:
17
17
  - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_perl/2.0.8 Perl/v5.20.0
18
- Pragma:
18
+ Pragma:
19
19
  - no-cache
20
- Date:
20
+ Date:
21
21
  - Sun, 12 Apr 2015 01:01:44 GMT
22
- Access-Control-Allow-Origin:
22
+ Access-Control-Allow-Origin:
23
23
  - "*"
24
- Content-Length:
24
+ Content-Length:
25
25
  - "353"
26
- X-Powered-By:
26
+ X-Powered-By:
27
27
  - PHP/5.6.2
28
- Expires:
28
+ Expires:
29
29
  - Thu, 01 Jan 1970 00:00:00 GMT
30
- Cache-Control:
30
+ Cache-Control:
31
31
  - private, must-revalidate, pre-check=0, post-check=0, max-age=0
32
- Content-Type:
32
+ Content-Type:
33
33
  - application/json
34
- Accept-Ranges:
34
+ Accept-Ranges:
35
35
  - none
36
- body:
36
+ body:
37
37
  string: "{\"users\":[{\"id\":5,\"firstname\":\"Austin\",\"lastname\":\"Powers\",\"fullname\":\"Austin Powers\",\"email\":\"austinp1@jobready.com.au\",\"firstaccess\":0,\"lastaccess\":0,\"profileimageurlsmall\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/69\\/user\\/icon\\/f2\",\"profileimageurl\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/69\\/user\\/icon\\/f1\"}],\"warnings\":[]}"
38
- http_version:
38
+ http_version:
39
39
  recorded_at: Sun, 12 Apr 2015 01:01:44 GMT
@@ -0,0 +1,39 @@
1
+ ---
2
+ recorded_with: VCR 2.9.3
3
+ http_interactions:
4
+ - request:
5
+ method: post
6
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_user_get_users&wstoken=
7
+ body:
8
+ string: criteria[0][value]=5&criteria[0][key]=id
9
+ headers: {}
10
+
11
+ response:
12
+ status:
13
+ code: 200
14
+ message: OK
15
+ headers:
16
+ Cache-Control:
17
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
18
+ Pragma:
19
+ - no-cache
20
+ Server:
21
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
22
+ Accept-Ranges:
23
+ - none
24
+ Content-Type:
25
+ - application/json
26
+ Date:
27
+ - Mon, 20 Jun 2016 22:30:45 GMT
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Access-Control-Allow-Origin:
31
+ - "*"
32
+ Content-Length:
33
+ - "103"
34
+ X-Powered-By:
35
+ - PHP/5.6.2
36
+ body:
37
+ string: "{\"exception\":\"moodle_exception\",\"errorcode\":\"invalidtoken\",\"message\":\"Invalid token - token not found\"}"
38
+ http_version:
39
+ recorded_at: Mon, 20 Jun 2016 22:30:45 GMT