diff --git a/tests/phpunit/tests/rest-api/rest-schema-setup.php b/tests/phpunit/tests/rest-api/rest-schema-setup.php
index a1f0049..80712ce 100644
a
|
b
|
class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase { |
275 | 275 | |
276 | 276 | $this->assertTrue( ! empty( $data ), $route['name'] . ' route should return data.' ); |
277 | 277 | |
278 | | $fixture = $this->normalize_fixture( $data, $route['name'] ); |
279 | | $mocked_responses .= "\nmockedApiResponse." . $route['name'] . ' = ' |
280 | | . json_encode( $fixture, JSON_PRETTY_PRINT ) |
281 | | . ";\n"; |
| 278 | if ( version_compare( PHP_VERSION, '5.4', '>=' ) ) { |
| 279 | $fixture = $this->normalize_fixture( $data, $route['name'] ); |
| 280 | $mocked_responses .= "\nmockedApiResponse." . $route['name'] . ' = ' |
| 281 | . json_encode( $fixture, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) |
| 282 | . ";\n"; |
| 283 | } |
282 | 284 | } |
283 | 285 | |
284 | | // Save the route object for QUnit tests. |
285 | | $file = './tests/qunit/fixtures/wp-api-generated.js'; |
286 | | file_put_contents( $file, $mocked_responses ); |
| 286 | if ( version_compare( PHP_VERSION, '5.4', '<' ) ) { |
| 287 | echo "Skipping generation of API client fixtures due to unsupported JSON_* constants.\n"; |
| 288 | } else { |
| 289 | // Save the route object for QUnit tests. |
| 290 | $file = './tests/qunit/fixtures/wp-api-generated.js'; |
| 291 | file_put_contents( $file, $mocked_responses ); |
| 292 | } |
287 | 293 | |
288 | 294 | // Clean up our test data. |
289 | 295 | wp_delete_post( $post_id, true ); |
diff --git a/tests/qunit/fixtures/wp-api-generated.js b/tests/qunit/fixtures/wp-api-generated.js
index b10d1fd..2adb53c 100644
a
|
b
|
var mockedApiResponse = {}; |
8 | 8 | mockedApiResponse.Schema = { |
9 | 9 | "name": "Test Blog", |
10 | 10 | "description": "Just another WordPress site", |
11 | | "url": "http:\/\/example.org", |
12 | | "home": "http:\/\/example.org", |
| 11 | "url": "http://example.org", |
| 12 | "home": "http://example.org", |
13 | 13 | "namespaces": [ |
14 | | "oembed\/1.0", |
15 | | "wp\/v2" |
| 14 | "oembed/1.0", |
| 15 | "wp/v2" |
16 | 16 | ], |
17 | 17 | "authentication": [], |
18 | 18 | "routes": { |
19 | | "\/": { |
| 19 | "/": { |
20 | 20 | "namespace": "", |
21 | 21 | "methods": [ |
22 | 22 | "GET" |
… |
… |
mockedApiResponse.Schema = { |
35 | 35 | } |
36 | 36 | ], |
37 | 37 | "_links": { |
38 | | "self": "http:\/\/example.org\/?rest_route=\/" |
| 38 | "self": "http://example.org/?rest_route=/" |
39 | 39 | } |
40 | 40 | }, |
41 | | "\/oembed\/1.0": { |
42 | | "namespace": "oembed\/1.0", |
| 41 | "/oembed/1.0": { |
| 42 | "namespace": "oembed/1.0", |
43 | 43 | "methods": [ |
44 | 44 | "GET" |
45 | 45 | ], |
… |
… |
mockedApiResponse.Schema = { |
51 | 51 | "args": { |
52 | 52 | "namespace": { |
53 | 53 | "required": false, |
54 | | "default": "oembed\/1.0" |
| 54 | "default": "oembed/1.0" |
55 | 55 | }, |
56 | 56 | "context": { |
57 | 57 | "required": false, |
… |
… |
mockedApiResponse.Schema = { |
61 | 61 | } |
62 | 62 | ], |
63 | 63 | "_links": { |
64 | | "self": "http:\/\/example.org\/?rest_route=\/oembed\/1.0" |
| 64 | "self": "http://example.org/?rest_route=/oembed/1.0" |
65 | 65 | } |
66 | 66 | }, |
67 | | "\/oembed\/1.0\/embed": { |
68 | | "namespace": "oembed\/1.0", |
| 67 | "/oembed/1.0/embed": { |
| 68 | "namespace": "oembed/1.0", |
69 | 69 | "methods": [ |
70 | 70 | "GET" |
71 | 71 | ], |
… |
… |
mockedApiResponse.Schema = { |
90 | 90 | } |
91 | 91 | ], |
92 | 92 | "_links": { |
93 | | "self": "http:\/\/example.org\/?rest_route=\/oembed\/1.0\/embed" |
| 93 | "self": "http://example.org/?rest_route=/oembed/1.0/embed" |
94 | 94 | } |
95 | 95 | }, |
96 | | "\/wp\/v2": { |
97 | | "namespace": "wp\/v2", |
| 96 | "/wp/v2": { |
| 97 | "namespace": "wp/v2", |
98 | 98 | "methods": [ |
99 | 99 | "GET" |
100 | 100 | ], |
… |
… |
mockedApiResponse.Schema = { |
106 | 106 | "args": { |
107 | 107 | "namespace": { |
108 | 108 | "required": false, |
109 | | "default": "wp\/v2" |
| 109 | "default": "wp/v2" |
110 | 110 | }, |
111 | 111 | "context": { |
112 | 112 | "required": false, |
… |
… |
mockedApiResponse.Schema = { |
116 | 116 | } |
117 | 117 | ], |
118 | 118 | "_links": { |
119 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2" |
| 119 | "self": "http://example.org/?rest_route=/wp/v2" |
120 | 120 | } |
121 | 121 | }, |
122 | | "\/wp\/v2\/posts": { |
123 | | "namespace": "wp\/v2", |
| 122 | "/wp/v2/posts": { |
| 123 | "namespace": "wp/v2", |
124 | 124 | "methods": [ |
125 | 125 | "GET", |
126 | 126 | "POST" |
… |
… |
mockedApiResponse.Schema = { |
431 | 431 | } |
432 | 432 | ], |
433 | 433 | "_links": { |
434 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/posts" |
| 434 | "self": "http://example.org/?rest_route=/wp/v2/posts" |
435 | 435 | } |
436 | 436 | }, |
437 | | "\/wp\/v2\/posts\/(?P<id>[\\d]+)": { |
438 | | "namespace": "wp\/v2", |
| 437 | "/wp/v2/posts/(?P<id>[\\d]+)": { |
| 438 | "namespace": "wp/v2", |
439 | 439 | "methods": [ |
440 | 440 | "GET", |
441 | 441 | "POST", |
… |
… |
mockedApiResponse.Schema = { |
623 | 623 | } |
624 | 624 | ] |
625 | 625 | }, |
626 | | "\/wp\/v2\/posts\/(?P<parent>[\\d]+)\/revisions": { |
627 | | "namespace": "wp\/v2", |
| 626 | "/wp/v2/posts/(?P<parent>[\\d]+)/revisions": { |
| 627 | "namespace": "wp/v2", |
628 | 628 | "methods": [ |
629 | 629 | "GET" |
630 | 630 | ], |
… |
… |
mockedApiResponse.Schema = { |
654 | 654 | } |
655 | 655 | ] |
656 | 656 | }, |
657 | | "\/wp\/v2\/posts\/(?P<parent>[\\d]+)\/revisions\/(?P<id>[\\d]+)": { |
658 | | "namespace": "wp\/v2", |
| 657 | "/wp/v2/posts/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)": { |
| 658 | "namespace": "wp/v2", |
659 | 659 | "methods": [ |
660 | 660 | "GET", |
661 | 661 | "DELETE" |
… |
… |
mockedApiResponse.Schema = { |
714 | 714 | } |
715 | 715 | ] |
716 | 716 | }, |
717 | | "\/wp\/v2\/pages": { |
718 | | "namespace": "wp\/v2", |
| 717 | "/wp/v2/pages": { |
| 718 | "namespace": "wp/v2", |
719 | 719 | "methods": [ |
720 | 720 | "GET", |
721 | 721 | "POST" |
… |
… |
mockedApiResponse.Schema = { |
990 | 990 | } |
991 | 991 | ], |
992 | 992 | "_links": { |
993 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/pages" |
| 993 | "self": "http://example.org/?rest_route=/wp/v2/pages" |
994 | 994 | } |
995 | 995 | }, |
996 | | "\/wp\/v2\/pages\/(?P<id>[\\d]+)": { |
997 | | "namespace": "wp\/v2", |
| 996 | "/wp/v2/pages/(?P<id>[\\d]+)": { |
| 997 | "namespace": "wp/v2", |
998 | 998 | "methods": [ |
999 | 999 | "GET", |
1000 | 1000 | "POST", |
… |
… |
mockedApiResponse.Schema = { |
1163 | 1163 | } |
1164 | 1164 | ] |
1165 | 1165 | }, |
1166 | | "\/wp\/v2\/pages\/(?P<parent>[\\d]+)\/revisions": { |
1167 | | "namespace": "wp\/v2", |
| 1166 | "/wp/v2/pages/(?P<parent>[\\d]+)/revisions": { |
| 1167 | "namespace": "wp/v2", |
1168 | 1168 | "methods": [ |
1169 | 1169 | "GET" |
1170 | 1170 | ], |
… |
… |
mockedApiResponse.Schema = { |
1194 | 1194 | } |
1195 | 1195 | ] |
1196 | 1196 | }, |
1197 | | "\/wp\/v2\/pages\/(?P<parent>[\\d]+)\/revisions\/(?P<id>[\\d]+)": { |
1198 | | "namespace": "wp\/v2", |
| 1197 | "/wp/v2/pages/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)": { |
| 1198 | "namespace": "wp/v2", |
1199 | 1199 | "methods": [ |
1200 | 1200 | "GET", |
1201 | 1201 | "DELETE" |
… |
… |
mockedApiResponse.Schema = { |
1254 | 1254 | } |
1255 | 1255 | ] |
1256 | 1256 | }, |
1257 | | "\/wp\/v2\/media": { |
1258 | | "namespace": "wp\/v2", |
| 1257 | "/wp/v2/media": { |
| 1258 | "namespace": "wp/v2", |
1259 | 1259 | "methods": [ |
1260 | 1260 | "GET", |
1261 | 1261 | "POST" |
… |
… |
mockedApiResponse.Schema = { |
1525 | 1525 | } |
1526 | 1526 | ], |
1527 | 1527 | "_links": { |
1528 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/media" |
| 1528 | "self": "http://example.org/?rest_route=/wp/v2/media" |
1529 | 1529 | } |
1530 | 1530 | }, |
1531 | | "\/wp\/v2\/media\/(?P<id>[\\d]+)": { |
1532 | | "namespace": "wp\/v2", |
| 1531 | "/wp/v2/media/(?P<id>[\\d]+)": { |
| 1532 | "namespace": "wp/v2", |
1533 | 1533 | "methods": [ |
1534 | 1534 | "GET", |
1535 | 1535 | "POST", |
… |
… |
mockedApiResponse.Schema = { |
1683 | 1683 | } |
1684 | 1684 | ] |
1685 | 1685 | }, |
1686 | | "\/wp\/v2\/types": { |
1687 | | "namespace": "wp\/v2", |
| 1686 | "/wp/v2/types": { |
| 1687 | "namespace": "wp/v2", |
1688 | 1688 | "methods": [ |
1689 | 1689 | "GET" |
1690 | 1690 | ], |
… |
… |
mockedApiResponse.Schema = { |
1709 | 1709 | } |
1710 | 1710 | ], |
1711 | 1711 | "_links": { |
1712 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/types" |
| 1712 | "self": "http://example.org/?rest_route=/wp/v2/types" |
1713 | 1713 | } |
1714 | 1714 | }, |
1715 | | "\/wp\/v2\/types\/(?P<type>[\\w-]+)": { |
1716 | | "namespace": "wp\/v2", |
| 1715 | "/wp/v2/types/(?P<type>[\\w-]+)": { |
| 1716 | "namespace": "wp/v2", |
1717 | 1717 | "methods": [ |
1718 | 1718 | "GET" |
1719 | 1719 | ], |
… |
… |
mockedApiResponse.Schema = { |
1743 | 1743 | } |
1744 | 1744 | ] |
1745 | 1745 | }, |
1746 | | "\/wp\/v2\/statuses": { |
1747 | | "namespace": "wp\/v2", |
| 1746 | "/wp/v2/statuses": { |
| 1747 | "namespace": "wp/v2", |
1748 | 1748 | "methods": [ |
1749 | 1749 | "GET" |
1750 | 1750 | ], |
… |
… |
mockedApiResponse.Schema = { |
1769 | 1769 | } |
1770 | 1770 | ], |
1771 | 1771 | "_links": { |
1772 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/statuses" |
| 1772 | "self": "http://example.org/?rest_route=/wp/v2/statuses" |
1773 | 1773 | } |
1774 | 1774 | }, |
1775 | | "\/wp\/v2\/statuses\/(?P<status>[\\w-]+)": { |
1776 | | "namespace": "wp\/v2", |
| 1775 | "/wp/v2/statuses/(?P<status>[\\w-]+)": { |
| 1776 | "namespace": "wp/v2", |
1777 | 1777 | "methods": [ |
1778 | 1778 | "GET" |
1779 | 1779 | ], |
… |
… |
mockedApiResponse.Schema = { |
1803 | 1803 | } |
1804 | 1804 | ] |
1805 | 1805 | }, |
1806 | | "\/wp\/v2\/taxonomies": { |
1807 | | "namespace": "wp\/v2", |
| 1806 | "/wp/v2/taxonomies": { |
| 1807 | "namespace": "wp/v2", |
1808 | 1808 | "methods": [ |
1809 | 1809 | "GET" |
1810 | 1810 | ], |
… |
… |
mockedApiResponse.Schema = { |
1834 | 1834 | } |
1835 | 1835 | ], |
1836 | 1836 | "_links": { |
1837 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/taxonomies" |
| 1837 | "self": "http://example.org/?rest_route=/wp/v2/taxonomies" |
1838 | 1838 | } |
1839 | 1839 | }, |
1840 | | "\/wp\/v2\/taxonomies\/(?P<taxonomy>[\\w-]+)": { |
1841 | | "namespace": "wp\/v2", |
| 1840 | "/wp/v2/taxonomies/(?P<taxonomy>[\\w-]+)": { |
| 1841 | "namespace": "wp/v2", |
1842 | 1842 | "methods": [ |
1843 | 1843 | "GET" |
1844 | 1844 | ], |
… |
… |
mockedApiResponse.Schema = { |
1868 | 1868 | } |
1869 | 1869 | ] |
1870 | 1870 | }, |
1871 | | "\/wp\/v2\/categories": { |
1872 | | "namespace": "wp\/v2", |
| 1871 | "/wp/v2/categories": { |
| 1872 | "namespace": "wp/v2", |
1873 | 1873 | "methods": [ |
1874 | 1874 | "GET", |
1875 | 1875 | "POST" |
… |
… |
mockedApiResponse.Schema = { |
2008 | 2008 | } |
2009 | 2009 | ], |
2010 | 2010 | "_links": { |
2011 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/categories" |
| 2011 | "self": "http://example.org/?rest_route=/wp/v2/categories" |
2012 | 2012 | } |
2013 | 2013 | }, |
2014 | | "\/wp\/v2\/categories\/(?P<id>[\\d]+)": { |
2015 | | "namespace": "wp\/v2", |
| 2014 | "/wp/v2/categories/(?P<id>[\\d]+)": { |
| 2015 | "namespace": "wp/v2", |
2016 | 2016 | "methods": [ |
2017 | 2017 | "GET", |
2018 | 2018 | "POST", |
… |
… |
mockedApiResponse.Schema = { |
2103 | 2103 | } |
2104 | 2104 | ] |
2105 | 2105 | }, |
2106 | | "\/wp\/v2\/tags": { |
2107 | | "namespace": "wp\/v2", |
| 2106 | "/wp/v2/tags": { |
| 2107 | "namespace": "wp/v2", |
2108 | 2108 | "methods": [ |
2109 | 2109 | "GET", |
2110 | 2110 | "POST" |
… |
… |
mockedApiResponse.Schema = { |
2238 | 2238 | } |
2239 | 2239 | ], |
2240 | 2240 | "_links": { |
2241 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/tags" |
| 2241 | "self": "http://example.org/?rest_route=/wp/v2/tags" |
2242 | 2242 | } |
2243 | 2243 | }, |
2244 | | "\/wp\/v2\/tags\/(?P<id>[\\d]+)": { |
2245 | | "namespace": "wp\/v2", |
| 2244 | "/wp/v2/tags/(?P<id>[\\d]+)": { |
| 2245 | "namespace": "wp/v2", |
2246 | 2246 | "methods": [ |
2247 | 2247 | "GET", |
2248 | 2248 | "POST", |
… |
… |
mockedApiResponse.Schema = { |
2328 | 2328 | } |
2329 | 2329 | ] |
2330 | 2330 | }, |
2331 | | "\/wp\/v2\/users": { |
2332 | | "namespace": "wp\/v2", |
| 2331 | "/wp/v2/users": { |
| 2332 | "namespace": "wp/v2", |
2333 | 2333 | "methods": [ |
2334 | 2334 | "GET", |
2335 | 2335 | "POST" |
… |
… |
mockedApiResponse.Schema = { |
2515 | 2515 | } |
2516 | 2516 | ], |
2517 | 2517 | "_links": { |
2518 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/users" |
| 2518 | "self": "http://example.org/?rest_route=/wp/v2/users" |
2519 | 2519 | } |
2520 | 2520 | }, |
2521 | | "\/wp\/v2\/users\/(?P<id>[\\d]+)": { |
2522 | | "namespace": "wp\/v2", |
| 2521 | "/wp/v2/users/(?P<id>[\\d]+)": { |
| 2522 | "namespace": "wp/v2", |
2523 | 2523 | "methods": [ |
2524 | 2524 | "GET", |
2525 | 2525 | "POST", |
… |
… |
mockedApiResponse.Schema = { |
2665 | 2665 | } |
2666 | 2666 | ] |
2667 | 2667 | }, |
2668 | | "\/wp\/v2\/users\/me": { |
2669 | | "namespace": "wp\/v2", |
| 2668 | "/wp/v2/users/me": { |
| 2669 | "namespace": "wp/v2", |
2670 | 2670 | "methods": [ |
2671 | 2671 | "GET", |
2672 | 2672 | "POST", |
… |
… |
mockedApiResponse.Schema = { |
2797 | 2797 | } |
2798 | 2798 | ], |
2799 | 2799 | "_links": { |
2800 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/me" |
| 2800 | "self": "http://example.org/?rest_route=/wp/v2/users/me" |
2801 | 2801 | } |
2802 | 2802 | }, |
2803 | | "\/wp\/v2\/comments": { |
2804 | | "namespace": "wp\/v2", |
| 2803 | "/wp/v2/comments": { |
| 2804 | "namespace": "wp/v2", |
2805 | 2805 | "methods": [ |
2806 | 2806 | "GET", |
2807 | 2807 | "POST" |
… |
… |
mockedApiResponse.Schema = { |
3041 | 3041 | } |
3042 | 3042 | ], |
3043 | 3043 | "_links": { |
3044 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/comments" |
| 3044 | "self": "http://example.org/?rest_route=/wp/v2/comments" |
3045 | 3045 | } |
3046 | 3046 | }, |
3047 | | "\/wp\/v2\/comments\/(?P<id>[\\d]+)": { |
3048 | | "namespace": "wp\/v2", |
| 3047 | "/wp/v2/comments/(?P<id>[\\d]+)": { |
| 3048 | "namespace": "wp/v2", |
3049 | 3049 | "methods": [ |
3050 | 3050 | "GET", |
3051 | 3051 | "POST", |
… |
… |
mockedApiResponse.Schema = { |
3186 | 3186 | } |
3187 | 3187 | ] |
3188 | 3188 | }, |
3189 | | "\/wp\/v2\/settings": { |
3190 | | "namespace": "wp\/v2", |
| 3189 | "/wp/v2/settings": { |
| 3190 | "namespace": "wp/v2", |
3191 | 3191 | "methods": [ |
3192 | 3192 | "GET", |
3193 | 3193 | "POST", |
… |
… |
mockedApiResponse.Schema = { |
3295 | 3295 | } |
3296 | 3296 | ], |
3297 | 3297 | "_links": { |
3298 | | "self": "http:\/\/example.org\/?rest_route=\/wp\/v2\/settings" |
| 3298 | "self": "http://example.org/?rest_route=/wp/v2/settings" |
3299 | 3299 | } |
3300 | 3300 | } |
3301 | 3301 | } |
3302 | 3302 | }; |
3303 | 3303 | |
3304 | 3304 | mockedApiResponse.oembed = { |
3305 | | "namespace": "oembed\/1.0", |
| 3305 | "namespace": "oembed/1.0", |
3306 | 3306 | "routes": { |
3307 | | "\/oembed\/1.0": { |
3308 | | "namespace": "oembed\/1.0", |
| 3307 | "/oembed/1.0": { |
| 3308 | "namespace": "oembed/1.0", |
3309 | 3309 | "methods": [ |
3310 | 3310 | "GET" |
3311 | 3311 | ], |
… |
… |
mockedApiResponse.oembed = { |
3317 | 3317 | "args": { |
3318 | 3318 | "namespace": { |
3319 | 3319 | "required": false, |
3320 | | "default": "oembed\/1.0" |
| 3320 | "default": "oembed/1.0" |
3321 | 3321 | }, |
3322 | 3322 | "context": { |
3323 | 3323 | "required": false, |
… |
… |
mockedApiResponse.oembed = { |
3327 | 3327 | } |
3328 | 3328 | ], |
3329 | 3329 | "_links": { |
3330 | | "self": "http:\/\/example.org\/?rest_route=\/oembed\/1.0" |
| 3330 | "self": "http://example.org/?rest_route=/oembed/1.0" |
3331 | 3331 | } |
3332 | 3332 | }, |
3333 | | "\/oembed\/1.0\/embed": { |
3334 | | "namespace": "oembed\/1.0", |
| 3333 | "/oembed/1.0/embed": { |
| 3334 | "namespace": "oembed/1.0", |
3335 | 3335 | "methods": [ |
3336 | 3336 | "GET" |
3337 | 3337 | ], |
… |
… |
mockedApiResponse.oembed = { |
3356 | 3356 | } |
3357 | 3357 | ], |
3358 | 3358 | "_links": { |
3359 | | "self": "http:\/\/example.org\/?rest_route=\/oembed\/1.0\/embed" |
| 3359 | "self": "http://example.org/?rest_route=/oembed/1.0/embed" |
3360 | 3360 | } |
3361 | 3361 | } |
3362 | 3362 | } |
… |
… |
mockedApiResponse.PostsCollection = [ |
3379 | 3379 | "date": "2017-02-14T00:00:00", |
3380 | 3380 | "date_gmt": "2017-02-14T00:00:00", |
3381 | 3381 | "guid": { |
3382 | | "rendered": "http:\/\/example.org\/?p=3" |
| 3382 | "rendered": "http://example.org/?p=3" |
3383 | 3383 | }, |
3384 | 3384 | "modified": "2017-02-14T00:00:00", |
3385 | 3385 | "modified_gmt": "2017-02-14T00:00:00", |
3386 | 3386 | "slug": "restapi-client-fixture-post", |
3387 | 3387 | "type": "post", |
3388 | | "link": "http:\/\/example.org\/?p=3", |
| 3388 | "link": "http://example.org/?p=3", |
3389 | 3389 | "title": { |
3390 | 3390 | "rendered": "REST API Client Fixture: Post" |
3391 | 3391 | }, |
3392 | 3392 | "content": { |
3393 | | "rendered": "<p>Updated post content.<\/p>\n", |
| 3393 | "rendered": "<p>Updated post content.</p>\n", |
3394 | 3394 | "protected": false |
3395 | 3395 | }, |
3396 | 3396 | "excerpt": { |
3397 | | "rendered": "<p>REST API Client Fixture: Post<\/p>\n", |
| 3397 | "rendered": "<p>REST API Client Fixture: Post</p>\n", |
3398 | 3398 | "protected": false |
3399 | 3399 | }, |
3400 | 3400 | "author": 0, |
… |
… |
mockedApiResponse.PostsCollection = [ |
3412 | 3412 | "_links": { |
3413 | 3413 | "self": [ |
3414 | 3414 | { |
3415 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3" |
| 3415 | "href": "http://example.org/?rest_route=/wp/v2/posts/3" |
3416 | 3416 | } |
3417 | 3417 | ], |
3418 | 3418 | "collection": [ |
3419 | 3419 | { |
3420 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/posts" |
| 3420 | "href": "http://example.org/?rest_route=/wp/v2/posts" |
3421 | 3421 | } |
3422 | 3422 | ], |
3423 | 3423 | "about": [ |
3424 | 3424 | { |
3425 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/post" |
| 3425 | "href": "http://example.org/?rest_route=/wp/v2/types/post" |
3426 | 3426 | } |
3427 | 3427 | ], |
3428 | 3428 | "replies": [ |
3429 | 3429 | { |
3430 | 3430 | "embeddable": true, |
3431 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=3" |
| 3431 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fcomments&post=3" |
3432 | 3432 | } |
3433 | 3433 | ], |
3434 | 3434 | "version-history": [ |
3435 | 3435 | { |
3436 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3\/revisions" |
| 3436 | "href": "http://example.org/?rest_route=/wp/v2/posts/3/revisions" |
3437 | 3437 | } |
3438 | 3438 | ], |
3439 | 3439 | "wp:attachment": [ |
3440 | 3440 | { |
3441 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3" |
| 3441 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3" |
3442 | 3442 | } |
3443 | 3443 | ], |
3444 | 3444 | "wp:term": [ |
3445 | 3445 | { |
3446 | 3446 | "taxonomy": "category", |
3447 | 3447 | "embeddable": true, |
3448 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcategories&post=3" |
| 3448 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fcategories&post=3" |
3449 | 3449 | }, |
3450 | 3450 | { |
3451 | 3451 | "taxonomy": "post_tag", |
3452 | 3452 | "embeddable": true, |
3453 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Ftags&post=3" |
| 3453 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Ftags&post=3" |
3454 | 3454 | } |
3455 | 3455 | ], |
3456 | 3456 | "curies": [ |
3457 | 3457 | { |
3458 | 3458 | "name": "wp", |
3459 | | "href": "https:\/\/api.w.org\/{rel}", |
| 3459 | "href": "https://api.w.org/{rel}", |
3460 | 3460 | "templated": true |
3461 | 3461 | } |
3462 | 3462 | ] |
… |
… |
mockedApiResponse.PostModel = { |
3469 | 3469 | "date": "2017-02-14T00:00:00", |
3470 | 3470 | "date_gmt": "2017-02-14T00:00:00", |
3471 | 3471 | "guid": { |
3472 | | "rendered": "http:\/\/example.org\/?p=3" |
| 3472 | "rendered": "http://example.org/?p=3" |
3473 | 3473 | }, |
3474 | 3474 | "modified": "2017-02-14T00:00:00", |
3475 | 3475 | "modified_gmt": "2017-02-14T00:00:00", |
3476 | 3476 | "slug": "restapi-client-fixture-post", |
3477 | 3477 | "type": "post", |
3478 | | "link": "http:\/\/example.org\/?p=3", |
| 3478 | "link": "http://example.org/?p=3", |
3479 | 3479 | "title": { |
3480 | 3480 | "rendered": "REST API Client Fixture: Post" |
3481 | 3481 | }, |
3482 | 3482 | "content": { |
3483 | | "rendered": "<p>Updated post content.<\/p>\n", |
| 3483 | "rendered": "<p>Updated post content.</p>\n", |
3484 | 3484 | "protected": false |
3485 | 3485 | }, |
3486 | 3486 | "excerpt": { |
3487 | | "rendered": "<p>REST API Client Fixture: Post<\/p>\n", |
| 3487 | "rendered": "<p>REST API Client Fixture: Post</p>\n", |
3488 | 3488 | "protected": false |
3489 | 3489 | }, |
3490 | 3490 | "author": 0, |
… |
… |
mockedApiResponse.postRevisions = [ |
3512 | 3512 | "parent": 3, |
3513 | 3513 | "slug": "3-revision-v1", |
3514 | 3514 | "guid": { |
3515 | | "rendered": "http:\/\/example.org\/?p=4" |
| 3515 | "rendered": "http://example.org/?p=4" |
3516 | 3516 | }, |
3517 | 3517 | "title": { |
3518 | 3518 | "rendered": "REST API Client Fixture: Post" |
3519 | 3519 | }, |
3520 | 3520 | "content": { |
3521 | | "rendered": "<p>Updated post content.<\/p>\n" |
| 3521 | "rendered": "<p>Updated post content.</p>\n" |
3522 | 3522 | }, |
3523 | 3523 | "excerpt": { |
3524 | | "rendered": "<p>REST API Client Fixture: Post<\/p>\n" |
| 3524 | "rendered": "<p>REST API Client Fixture: Post</p>\n" |
3525 | 3525 | }, |
3526 | 3526 | "_links": { |
3527 | 3527 | "parent": [ |
3528 | 3528 | { |
3529 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3" |
| 3529 | "href": "http://example.org/?rest_route=/wp/v2/posts/3" |
3530 | 3530 | } |
3531 | 3531 | ] |
3532 | 3532 | } |
… |
… |
mockedApiResponse.PagesCollection = [ |
3547 | 3547 | "date": "2017-02-14T00:00:00", |
3548 | 3548 | "date_gmt": "2017-02-14T00:00:00", |
3549 | 3549 | "guid": { |
3550 | | "rendered": "http:\/\/example.org\/?page_id=5" |
| 3550 | "rendered": "http://example.org/?page_id=5" |
3551 | 3551 | }, |
3552 | 3552 | "modified": "2017-02-14T00:00:00", |
3553 | 3553 | "modified_gmt": "2017-02-14T00:00:00", |
3554 | 3554 | "slug": "restapi-client-fixture-page", |
3555 | 3555 | "type": "page", |
3556 | | "link": "http:\/\/example.org\/?page_id=5", |
| 3556 | "link": "http://example.org/?page_id=5", |
3557 | 3557 | "title": { |
3558 | 3558 | "rendered": "REST API Client Fixture: Page" |
3559 | 3559 | }, |
3560 | 3560 | "content": { |
3561 | | "rendered": "<p>Updated page content.<\/p>\n", |
| 3561 | "rendered": "<p>Updated page content.</p>\n", |
3562 | 3562 | "protected": false |
3563 | 3563 | }, |
3564 | 3564 | "excerpt": { |
3565 | | "rendered": "<p>REST API Client Fixture: Page<\/p>\n", |
| 3565 | "rendered": "<p>REST API Client Fixture: Page</p>\n", |
3566 | 3566 | "protected": false |
3567 | 3567 | }, |
3568 | 3568 | "author": 0, |
… |
… |
mockedApiResponse.PagesCollection = [ |
3576 | 3576 | "_links": { |
3577 | 3577 | "self": [ |
3578 | 3578 | { |
3579 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/5" |
| 3579 | "href": "http://example.org/?rest_route=/wp/v2/pages/5" |
3580 | 3580 | } |
3581 | 3581 | ], |
3582 | 3582 | "collection": [ |
3583 | 3583 | { |
3584 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/pages" |
| 3584 | "href": "http://example.org/?rest_route=/wp/v2/pages" |
3585 | 3585 | } |
3586 | 3586 | ], |
3587 | 3587 | "about": [ |
3588 | 3588 | { |
3589 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/page" |
| 3589 | "href": "http://example.org/?rest_route=/wp/v2/types/page" |
3590 | 3590 | } |
3591 | 3591 | ], |
3592 | 3592 | "replies": [ |
3593 | 3593 | { |
3594 | 3594 | "embeddable": true, |
3595 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=5" |
| 3595 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fcomments&post=5" |
3596 | 3596 | } |
3597 | 3597 | ], |
3598 | 3598 | "version-history": [ |
3599 | 3599 | { |
3600 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/5\/revisions" |
| 3600 | "href": "http://example.org/?rest_route=/wp/v2/pages/5/revisions" |
3601 | 3601 | } |
3602 | 3602 | ], |
3603 | 3603 | "wp:attachment": [ |
3604 | 3604 | { |
3605 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5" |
| 3605 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5" |
3606 | 3606 | } |
3607 | 3607 | ], |
3608 | 3608 | "curies": [ |
3609 | 3609 | { |
3610 | 3610 | "name": "wp", |
3611 | | "href": "https:\/\/api.w.org\/{rel}", |
| 3611 | "href": "https://api.w.org/{rel}", |
3612 | 3612 | "templated": true |
3613 | 3613 | } |
3614 | 3614 | ] |
… |
… |
mockedApiResponse.PageModel = { |
3621 | 3621 | "date": "2017-02-14T00:00:00", |
3622 | 3622 | "date_gmt": "2017-02-14T00:00:00", |
3623 | 3623 | "guid": { |
3624 | | "rendered": "http:\/\/example.org\/?page_id=5" |
| 3624 | "rendered": "http://example.org/?page_id=5" |
3625 | 3625 | }, |
3626 | 3626 | "modified": "2017-02-14T00:00:00", |
3627 | 3627 | "modified_gmt": "2017-02-14T00:00:00", |
3628 | 3628 | "slug": "restapi-client-fixture-page", |
3629 | 3629 | "type": "page", |
3630 | | "link": "http:\/\/example.org\/?page_id=5", |
| 3630 | "link": "http://example.org/?page_id=5", |
3631 | 3631 | "title": { |
3632 | 3632 | "rendered": "REST API Client Fixture: Page" |
3633 | 3633 | }, |
3634 | 3634 | "content": { |
3635 | | "rendered": "<p>Updated page content.<\/p>\n", |
| 3635 | "rendered": "<p>Updated page content.</p>\n", |
3636 | 3636 | "protected": false |
3637 | 3637 | }, |
3638 | 3638 | "excerpt": { |
3639 | | "rendered": "<p>REST API Client Fixture: Page<\/p>\n", |
| 3639 | "rendered": "<p>REST API Client Fixture: Page</p>\n", |
3640 | 3640 | "protected": false |
3641 | 3641 | }, |
3642 | 3642 | "author": 0, |
… |
… |
mockedApiResponse.pageRevisions = [ |
3660 | 3660 | "parent": 5, |
3661 | 3661 | "slug": "5-revision-v1", |
3662 | 3662 | "guid": { |
3663 | | "rendered": "http:\/\/example.org\/?p=6" |
| 3663 | "rendered": "http://example.org/?p=6" |
3664 | 3664 | }, |
3665 | 3665 | "title": { |
3666 | 3666 | "rendered": "REST API Client Fixture: Page" |
3667 | 3667 | }, |
3668 | 3668 | "content": { |
3669 | | "rendered": "<p>Updated page content.<\/p>\n" |
| 3669 | "rendered": "<p>Updated page content.</p>\n" |
3670 | 3670 | }, |
3671 | 3671 | "excerpt": { |
3672 | | "rendered": "<p>REST API Client Fixture: Page<\/p>\n" |
| 3672 | "rendered": "<p>REST API Client Fixture: Page</p>\n" |
3673 | 3673 | }, |
3674 | 3674 | "_links": { |
3675 | 3675 | "parent": [ |
3676 | 3676 | { |
3677 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/5" |
| 3677 | "href": "http://example.org/?rest_route=/wp/v2/pages/5" |
3678 | 3678 | } |
3679 | 3679 | ] |
3680 | 3680 | } |
… |
… |
mockedApiResponse.MediaCollection = [ |
3695 | 3695 | "date": "2017-02-14T00:00:00", |
3696 | 3696 | "date_gmt": "2017-02-14T00:00:00", |
3697 | 3697 | "guid": { |
3698 | | "rendered": "http:\/\/example.org\/?attachment_id=7" |
| 3698 | "rendered": "http://example.org/?attachment_id=7" |
3699 | 3699 | }, |
3700 | 3700 | "modified": "2017-02-14T00:00:00", |
3701 | 3701 | "modified_gmt": "2017-02-14T00:00:00", |
3702 | 3702 | "slug": "restapi-client-fixture-attachment", |
3703 | 3703 | "type": "attachment", |
3704 | | "link": "http:\/\/example.org\/?attachment_id=7", |
| 3704 | "link": "http://example.org/?attachment_id=7", |
3705 | 3705 | "title": { |
3706 | 3706 | "rendered": "REST API Client Fixture: Attachment" |
3707 | 3707 | }, |
… |
… |
mockedApiResponse.MediaCollection = [ |
3711 | 3711 | "template": "", |
3712 | 3712 | "meta": [], |
3713 | 3713 | "description": { |
3714 | | "rendered": "<p class=\"attachment\"><a href='http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg'><img width=\"1\" height=\"1\" src=\"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a><\/p>\n" |
| 3714 | "rendered": "<p class=\"attachment\"><a href='http://example.org/wp-content/uploads//tmp/canola.jpg'><img width=\"1\" height=\"1\" src=\"http://example.org/wp-content/uploads//tmp/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" /></a></p>\n" |
3715 | 3715 | }, |
3716 | 3716 | "caption": { |
3717 | | "rendered": "<p>A sample caption<\/p>\n" |
| 3717 | "rendered": "<p>A sample caption</p>\n" |
3718 | 3718 | }, |
3719 | 3719 | "alt_text": "", |
3720 | 3720 | "media_type": "image", |
3721 | | "mime_type": "image\/jpeg", |
| 3721 | "mime_type": "image/jpeg", |
3722 | 3722 | "media_details": {}, |
3723 | 3723 | "post": null, |
3724 | | "source_url": "http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg", |
| 3724 | "source_url": "http://example.org/wp-content/uploads//tmp/canola.jpg", |
3725 | 3725 | "_links": { |
3726 | 3726 | "self": [ |
3727 | 3727 | { |
3728 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/media\/7" |
| 3728 | "href": "http://example.org/?rest_route=/wp/v2/media/7" |
3729 | 3729 | } |
3730 | 3730 | ], |
3731 | 3731 | "collection": [ |
3732 | 3732 | { |
3733 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/media" |
| 3733 | "href": "http://example.org/?rest_route=/wp/v2/media" |
3734 | 3734 | } |
3735 | 3735 | ], |
3736 | 3736 | "about": [ |
3737 | 3737 | { |
3738 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/attachment" |
| 3738 | "href": "http://example.org/?rest_route=/wp/v2/types/attachment" |
3739 | 3739 | } |
3740 | 3740 | ], |
3741 | 3741 | "replies": [ |
3742 | 3742 | { |
3743 | 3743 | "embeddable": true, |
3744 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=7" |
| 3744 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fcomments&post=7" |
3745 | 3745 | } |
3746 | 3746 | ] |
3747 | 3747 | } |
… |
… |
mockedApiResponse.MediaModel = { |
3753 | 3753 | "date": "2017-02-14T00:00:00", |
3754 | 3754 | "date_gmt": "2017-02-14T00:00:00", |
3755 | 3755 | "guid": { |
3756 | | "rendered": "http:\/\/example.org\/?attachment_id=7" |
| 3756 | "rendered": "http://example.org/?attachment_id=7" |
3757 | 3757 | }, |
3758 | 3758 | "modified": "2017-02-14T00:00:00", |
3759 | 3759 | "modified_gmt": "2017-02-14T00:00:00", |
3760 | 3760 | "slug": "restapi-client-fixture-attachment", |
3761 | 3761 | "type": "attachment", |
3762 | | "link": "http:\/\/example.org\/?attachment_id=7", |
| 3762 | "link": "http://example.org/?attachment_id=7", |
3763 | 3763 | "title": { |
3764 | 3764 | "rendered": "REST API Client Fixture: Attachment" |
3765 | 3765 | }, |
… |
… |
mockedApiResponse.MediaModel = { |
3769 | 3769 | "template": "", |
3770 | 3770 | "meta": [], |
3771 | 3771 | "description": { |
3772 | | "rendered": "<p class=\"attachment\"><a href='http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg'><img width=\"1\" height=\"1\" src=\"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a><\/p>\n" |
| 3772 | "rendered": "<p class=\"attachment\"><a href='http://example.org/wp-content/uploads//tmp/canola.jpg'><img width=\"1\" height=\"1\" src=\"http://example.org/wp-content/uploads//tmp/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" /></a></p>\n" |
3773 | 3773 | }, |
3774 | 3774 | "caption": { |
3775 | | "rendered": "<p>A sample caption<\/p>\n" |
| 3775 | "rendered": "<p>A sample caption</p>\n" |
3776 | 3776 | }, |
3777 | 3777 | "alt_text": "", |
3778 | 3778 | "media_type": "image", |
3779 | | "mime_type": "image\/jpeg", |
| 3779 | "mime_type": "image/jpeg", |
3780 | 3780 | "media_details": {}, |
3781 | 3781 | "post": null, |
3782 | | "source_url": "http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg" |
| 3782 | "source_url": "http://example.org/wp-content/uploads//tmp/canola.jpg" |
3783 | 3783 | }; |
3784 | 3784 | |
3785 | 3785 | mockedApiResponse.TypesCollection = { |
… |
… |
mockedApiResponse.TypesCollection = { |
3796 | 3796 | "_links": { |
3797 | 3797 | "collection": [ |
3798 | 3798 | { |
3799 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/types" |
| 3799 | "href": "http://example.org/?rest_route=/wp/v2/types" |
3800 | 3800 | } |
3801 | 3801 | ], |
3802 | 3802 | "wp:items": [ |
3803 | 3803 | { |
3804 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/posts" |
| 3804 | "href": "http://example.org/?rest_route=/wp/v2/posts" |
3805 | 3805 | } |
3806 | 3806 | ], |
3807 | 3807 | "curies": [ |
3808 | 3808 | { |
3809 | 3809 | "name": "wp", |
3810 | | "href": "https:\/\/api.w.org\/{rel}", |
| 3810 | "href": "https://api.w.org/{rel}", |
3811 | 3811 | "templated": true |
3812 | 3812 | } |
3813 | 3813 | ] |
… |
… |
mockedApiResponse.TypesCollection = { |
3823 | 3823 | "_links": { |
3824 | 3824 | "collection": [ |
3825 | 3825 | { |
3826 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/types" |
| 3826 | "href": "http://example.org/?rest_route=/wp/v2/types" |
3827 | 3827 | } |
3828 | 3828 | ], |
3829 | 3829 | "wp:items": [ |
3830 | 3830 | { |
3831 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/pages" |
| 3831 | "href": "http://example.org/?rest_route=/wp/v2/pages" |
3832 | 3832 | } |
3833 | 3833 | ], |
3834 | 3834 | "curies": [ |
3835 | 3835 | { |
3836 | 3836 | "name": "wp", |
3837 | | "href": "https:\/\/api.w.org\/{rel}", |
| 3837 | "href": "https://api.w.org/{rel}", |
3838 | 3838 | "templated": true |
3839 | 3839 | } |
3840 | 3840 | ] |
… |
… |
mockedApiResponse.TypesCollection = { |
3850 | 3850 | "_links": { |
3851 | 3851 | "collection": [ |
3852 | 3852 | { |
3853 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/types" |
| 3853 | "href": "http://example.org/?rest_route=/wp/v2/types" |
3854 | 3854 | } |
3855 | 3855 | ], |
3856 | 3856 | "wp:items": [ |
3857 | 3857 | { |
3858 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/media" |
| 3858 | "href": "http://example.org/?rest_route=/wp/v2/media" |
3859 | 3859 | } |
3860 | 3860 | ], |
3861 | 3861 | "curies": [ |
3862 | 3862 | { |
3863 | 3863 | "name": "wp", |
3864 | | "href": "https:\/\/api.w.org\/{rel}", |
| 3864 | "href": "https://api.w.org/{rel}", |
3865 | 3865 | "templated": true |
3866 | 3866 | } |
3867 | 3867 | ] |
… |
… |
mockedApiResponse.StatusesCollection = { |
3886 | 3886 | "_links": { |
3887 | 3887 | "archives": [ |
3888 | 3888 | { |
3889 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/posts" |
| 3889 | "href": "http://example.org/?rest_route=/wp/v2/posts" |
3890 | 3890 | } |
3891 | 3891 | ] |
3892 | 3892 | } |
… |
… |
mockedApiResponse.StatusesCollection = { |
3899 | 3899 | "_links": { |
3900 | 3900 | "archives": [ |
3901 | 3901 | { |
3902 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fposts&status=future" |
| 3902 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&status=future" |
3903 | 3903 | } |
3904 | 3904 | ] |
3905 | 3905 | } |
… |
… |
mockedApiResponse.StatusesCollection = { |
3912 | 3912 | "_links": { |
3913 | 3913 | "archives": [ |
3914 | 3914 | { |
3915 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fposts&status=draft" |
| 3915 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&status=draft" |
3916 | 3916 | } |
3917 | 3917 | ] |
3918 | 3918 | } |
… |
… |
mockedApiResponse.StatusesCollection = { |
3925 | 3925 | "_links": { |
3926 | 3926 | "archives": [ |
3927 | 3927 | { |
3928 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fposts&status=pending" |
| 3928 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&status=pending" |
3929 | 3929 | } |
3930 | 3930 | ] |
3931 | 3931 | } |
… |
… |
mockedApiResponse.StatusesCollection = { |
3938 | 3938 | "_links": { |
3939 | 3939 | "archives": [ |
3940 | 3940 | { |
3941 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fposts&status=private" |
| 3941 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&status=private" |
3942 | 3942 | } |
3943 | 3943 | ] |
3944 | 3944 | } |
… |
… |
mockedApiResponse.StatusesCollection = { |
3951 | 3951 | "_links": { |
3952 | 3952 | "archives": [ |
3953 | 3953 | { |
3954 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fposts&status=trash" |
| 3954 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&status=trash" |
3955 | 3955 | } |
3956 | 3956 | ] |
3957 | 3957 | } |
… |
… |
mockedApiResponse.TaxonomiesCollection = { |
3978 | 3978 | "_links": { |
3979 | 3979 | "collection": [ |
3980 | 3980 | { |
3981 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/taxonomies" |
| 3981 | "href": "http://example.org/?rest_route=/wp/v2/taxonomies" |
3982 | 3982 | } |
3983 | 3983 | ], |
3984 | 3984 | "wp:items": [ |
3985 | 3985 | { |
3986 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/categories" |
| 3986 | "href": "http://example.org/?rest_route=/wp/v2/categories" |
3987 | 3987 | } |
3988 | 3988 | ], |
3989 | 3989 | "curies": [ |
3990 | 3990 | { |
3991 | 3991 | "name": "wp", |
3992 | | "href": "https:\/\/api.w.org\/{rel}", |
| 3992 | "href": "https://api.w.org/{rel}", |
3993 | 3993 | "templated": true |
3994 | 3994 | } |
3995 | 3995 | ] |
… |
… |
mockedApiResponse.TaxonomiesCollection = { |
4007 | 4007 | "_links": { |
4008 | 4008 | "collection": [ |
4009 | 4009 | { |
4010 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/taxonomies" |
| 4010 | "href": "http://example.org/?rest_route=/wp/v2/taxonomies" |
4011 | 4011 | } |
4012 | 4012 | ], |
4013 | 4013 | "wp:items": [ |
4014 | 4014 | { |
4015 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/tags" |
| 4015 | "href": "http://example.org/?rest_route=/wp/v2/tags" |
4016 | 4016 | } |
4017 | 4017 | ], |
4018 | 4018 | "curies": [ |
4019 | 4019 | { |
4020 | 4020 | "name": "wp", |
4021 | | "href": "https:\/\/api.w.org\/{rel}", |
| 4021 | "href": "https://api.w.org/{rel}", |
4022 | 4022 | "templated": true |
4023 | 4023 | } |
4024 | 4024 | ] |
… |
… |
mockedApiResponse.CategoriesCollection = [ |
4042 | 4042 | "id": 1, |
4043 | 4043 | "count": 1, |
4044 | 4044 | "description": "", |
4045 | | "link": "http:\/\/example.org\/?cat=1", |
| 4045 | "link": "http://example.org/?cat=1", |
4046 | 4046 | "name": "Uncategorized", |
4047 | 4047 | "slug": "uncategorized", |
4048 | 4048 | "taxonomy": "category", |
… |
… |
mockedApiResponse.CategoriesCollection = [ |
4051 | 4051 | "_links": { |
4052 | 4052 | "self": [ |
4053 | 4053 | { |
4054 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/categories\/1" |
| 4054 | "href": "http://example.org/?rest_route=/wp/v2/categories/1" |
4055 | 4055 | } |
4056 | 4056 | ], |
4057 | 4057 | "collection": [ |
4058 | 4058 | { |
4059 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/categories" |
| 4059 | "href": "http://example.org/?rest_route=/wp/v2/categories" |
4060 | 4060 | } |
4061 | 4061 | ], |
4062 | 4062 | "about": [ |
4063 | 4063 | { |
4064 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/taxonomies\/category" |
| 4064 | "href": "http://example.org/?rest_route=/wp/v2/taxonomies/category" |
4065 | 4065 | } |
4066 | 4066 | ], |
4067 | 4067 | "wp:post_type": [ |
4068 | 4068 | { |
4069 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fposts&categories=1" |
| 4069 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&categories=1" |
4070 | 4070 | } |
4071 | 4071 | ], |
4072 | 4072 | "curies": [ |
4073 | 4073 | { |
4074 | 4074 | "name": "wp", |
4075 | | "href": "https:\/\/api.w.org\/{rel}", |
| 4075 | "href": "https://api.w.org/{rel}", |
4076 | 4076 | "templated": true |
4077 | 4077 | } |
4078 | 4078 | ] |
… |
… |
mockedApiResponse.CategoryModel = { |
4084 | 4084 | "id": 1, |
4085 | 4085 | "count": 1, |
4086 | 4086 | "description": "", |
4087 | | "link": "http:\/\/example.org\/?cat=1", |
| 4087 | "link": "http://example.org/?cat=1", |
4088 | 4088 | "name": "Uncategorized", |
4089 | 4089 | "slug": "uncategorized", |
4090 | 4090 | "taxonomy": "category", |
… |
… |
mockedApiResponse.TagsCollection = [ |
4097 | 4097 | "id": 2, |
4098 | 4098 | "count": 0, |
4099 | 4099 | "description": "REST API Client Fixture: Tag", |
4100 | | "link": "http:\/\/example.org\/?tag=restapi-client-fixture-tag", |
| 4100 | "link": "http://example.org/?tag=restapi-client-fixture-tag", |
4101 | 4101 | "name": "REST API Client Fixture: Tag", |
4102 | 4102 | "slug": "restapi-client-fixture-tag", |
4103 | 4103 | "taxonomy": "post_tag", |
… |
… |
mockedApiResponse.TagsCollection = [ |
4105 | 4105 | "_links": { |
4106 | 4106 | "self": [ |
4107 | 4107 | { |
4108 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/tags\/2" |
| 4108 | "href": "http://example.org/?rest_route=/wp/v2/tags/2" |
4109 | 4109 | } |
4110 | 4110 | ], |
4111 | 4111 | "collection": [ |
4112 | 4112 | { |
4113 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/tags" |
| 4113 | "href": "http://example.org/?rest_route=/wp/v2/tags" |
4114 | 4114 | } |
4115 | 4115 | ], |
4116 | 4116 | "about": [ |
4117 | 4117 | { |
4118 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/taxonomies\/post_tag" |
| 4118 | "href": "http://example.org/?rest_route=/wp/v2/taxonomies/post_tag" |
4119 | 4119 | } |
4120 | 4120 | ], |
4121 | 4121 | "wp:post_type": [ |
4122 | 4122 | { |
4123 | | "href": "http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fposts&tags=2" |
| 4123 | "href": "http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&tags=2" |
4124 | 4124 | } |
4125 | 4125 | ], |
4126 | 4126 | "curies": [ |
4127 | 4127 | { |
4128 | 4128 | "name": "wp", |
4129 | | "href": "https:\/\/api.w.org\/{rel}", |
| 4129 | "href": "https://api.w.org/{rel}", |
4130 | 4130 | "templated": true |
4131 | 4131 | } |
4132 | 4132 | ] |
… |
… |
mockedApiResponse.TagModel = { |
4138 | 4138 | "id": 2, |
4139 | 4139 | "count": 0, |
4140 | 4140 | "description": "REST API Client Fixture: Tag", |
4141 | | "link": "http:\/\/example.org\/?tag=restapi-client-fixture-tag", |
| 4141 | "link": "http://example.org/?tag=restapi-client-fixture-tag", |
4142 | 4142 | "name": "REST API Client Fixture: Tag", |
4143 | 4143 | "slug": "restapi-client-fixture-tag", |
4144 | 4144 | "taxonomy": "post_tag", |
… |
… |
mockedApiResponse.UsersCollection = [ |
4151 | 4151 | "name": "admin", |
4152 | 4152 | "url": "", |
4153 | 4153 | "description": "", |
4154 | | "link": "http:\/\/example.org\/?author=1", |
| 4154 | "link": "http://example.org/?author=1", |
4155 | 4155 | "slug": "admin", |
4156 | 4156 | "avatar_urls": { |
4157 | | "24": "http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=24&d=mm&r=g", |
4158 | | "48": "http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=48&d=mm&r=g", |
4159 | | "96": "http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=96&d=mm&r=g" |
| 4157 | "24": "http://0.gravatar.com/avatar/96614ec98aa0c0d2ee75796dced6df54?s=24&d=mm&r=g", |
| 4158 | "48": "http://0.gravatar.com/avatar/96614ec98aa0c0d2ee75796dced6df54?s=48&d=mm&r=g", |
| 4159 | "96": "http://0.gravatar.com/avatar/96614ec98aa0c0d2ee75796dced6df54?s=96&d=mm&r=g" |
4160 | 4160 | }, |
4161 | 4161 | "meta": [], |
4162 | 4162 | "_links": { |
4163 | 4163 | "self": [ |
4164 | 4164 | { |
4165 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/1" |
| 4165 | "href": "http://example.org/?rest_route=/wp/v2/users/1" |
4166 | 4166 | } |
4167 | 4167 | ], |
4168 | 4168 | "collection": [ |
4169 | 4169 | { |
4170 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/users" |
| 4170 | "href": "http://example.org/?rest_route=/wp/v2/users" |
4171 | 4171 | } |
4172 | 4172 | ] |
4173 | 4173 | } |
… |
… |
mockedApiResponse.UsersCollection = [ |
4177 | 4177 | "name": "REST API Client Fixture: User", |
4178 | 4178 | "url": "", |
4179 | 4179 | "description": "", |
4180 | | "link": "http:\/\/example.org\/?author=2", |
| 4180 | "link": "http://example.org/?author=2", |
4181 | 4181 | "slug": "restapiclientfixtureuser", |
4182 | 4182 | "avatar_urls": { |
4183 | | "24": "http:\/\/2.gravatar.com\/avatar\/57cbd982c963c7eb2294e2eee1b4448e?s=24&d=mm&r=g", |
4184 | | "48": "http:\/\/2.gravatar.com\/avatar\/57cbd982c963c7eb2294e2eee1b4448e?s=48&d=mm&r=g", |
4185 | | "96": "http:\/\/2.gravatar.com\/avatar\/57cbd982c963c7eb2294e2eee1b4448e?s=96&d=mm&r=g" |
| 4183 | "24": "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=24&d=mm&r=g", |
| 4184 | "48": "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=48&d=mm&r=g", |
| 4185 | "96": "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=96&d=mm&r=g" |
4186 | 4186 | }, |
4187 | 4187 | "meta": [], |
4188 | 4188 | "_links": { |
4189 | 4189 | "self": [ |
4190 | 4190 | { |
4191 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/2" |
| 4191 | "href": "http://example.org/?rest_route=/wp/v2/users/2" |
4192 | 4192 | } |
4193 | 4193 | ], |
4194 | 4194 | "collection": [ |
4195 | 4195 | { |
4196 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/users" |
| 4196 | "href": "http://example.org/?rest_route=/wp/v2/users" |
4197 | 4197 | } |
4198 | 4198 | ] |
4199 | 4199 | } |
… |
… |
mockedApiResponse.UserModel = { |
4205 | 4205 | "name": "REST API Client Fixture: User", |
4206 | 4206 | "url": "", |
4207 | 4207 | "description": "", |
4208 | | "link": "http:\/\/example.org\/?author=2", |
| 4208 | "link": "http://example.org/?author=2", |
4209 | 4209 | "slug": "restapiclientfixtureuser", |
4210 | 4210 | "avatar_urls": { |
4211 | | "24": "http:\/\/2.gravatar.com\/avatar\/57cbd982c963c7eb2294e2eee1b4448e?s=24&d=mm&r=g", |
4212 | | "48": "http:\/\/2.gravatar.com\/avatar\/57cbd982c963c7eb2294e2eee1b4448e?s=48&d=mm&r=g", |
4213 | | "96": "http:\/\/2.gravatar.com\/avatar\/57cbd982c963c7eb2294e2eee1b4448e?s=96&d=mm&r=g" |
| 4211 | "24": "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=24&d=mm&r=g", |
| 4212 | "48": "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=48&d=mm&r=g", |
| 4213 | "96": "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=96&d=mm&r=g" |
4214 | 4214 | }, |
4215 | 4215 | "meta": [] |
4216 | 4216 | }; |
… |
… |
mockedApiResponse.me = { |
4220 | 4220 | "name": "REST API Client Fixture: User", |
4221 | 4221 | "url": "", |
4222 | 4222 | "description": "", |
4223 | | "link": "http:\/\/example.org\/?author=2", |
| 4223 | "link": "http://example.org/?author=2", |
4224 | 4224 | "slug": "restapiclientfixtureuser", |
4225 | 4225 | "avatar_urls": { |
4226 | | "24": "http:\/\/2.gravatar.com\/avatar\/57cbd982c963c7eb2294e2eee1b4448e?s=24&d=mm&r=g", |
4227 | | "48": "http:\/\/2.gravatar.com\/avatar\/57cbd982c963c7eb2294e2eee1b4448e?s=48&d=mm&r=g", |
4228 | | "96": "http:\/\/2.gravatar.com\/avatar\/57cbd982c963c7eb2294e2eee1b4448e?s=96&d=mm&r=g" |
| 4226 | "24": "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=24&d=mm&r=g", |
| 4227 | "48": "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=48&d=mm&r=g", |
| 4228 | "96": "http://2.gravatar.com/avatar/57cbd982c963c7eb2294e2eee1b4448e?s=96&d=mm&r=g" |
4229 | 4229 | }, |
4230 | 4230 | "meta": [] |
4231 | 4231 | }; |
… |
… |
mockedApiResponse.CommentsCollection = [ |
4237 | 4237 | "parent": 0, |
4238 | 4238 | "author": 0, |
4239 | 4239 | "author_name": "Internet of something or other", |
4240 | | "author_url": "http:\/\/lights.example.org\/", |
| 4240 | "author_url": "http://lights.example.org/", |
4241 | 4241 | "date": "2017-02-14T00:00:00", |
4242 | 4242 | "date_gmt": "2017-02-14T00:00:00", |
4243 | 4243 | "content": { |
4244 | | "rendered": "<p>This is a comment<\/p>\n" |
| 4244 | "rendered": "<p>This is a comment</p>\n" |
4245 | 4245 | }, |
4246 | | "link": "http:\/\/example.org\/?p=3#comment-2", |
| 4246 | "link": "http://example.org/?p=3#comment-2", |
4247 | 4247 | "status": "approved", |
4248 | 4248 | "type": "comment", |
4249 | 4249 | "author_avatar_urls": { |
4250 | | "24": "http:\/\/2.gravatar.com\/avatar\/bd7c2b505bcf39cc71cfee564c614956?s=24&d=mm&r=g", |
4251 | | "48": "http:\/\/2.gravatar.com\/avatar\/bd7c2b505bcf39cc71cfee564c614956?s=48&d=mm&r=g", |
4252 | | "96": "http:\/\/2.gravatar.com\/avatar\/bd7c2b505bcf39cc71cfee564c614956?s=96&d=mm&r=g" |
| 4250 | "24": "http://2.gravatar.com/avatar/bd7c2b505bcf39cc71cfee564c614956?s=24&d=mm&r=g", |
| 4251 | "48": "http://2.gravatar.com/avatar/bd7c2b505bcf39cc71cfee564c614956?s=48&d=mm&r=g", |
| 4252 | "96": "http://2.gravatar.com/avatar/bd7c2b505bcf39cc71cfee564c614956?s=96&d=mm&r=g" |
4253 | 4253 | }, |
4254 | 4254 | "meta": [], |
4255 | 4255 | "_links": { |
4256 | 4256 | "self": [ |
4257 | 4257 | { |
4258 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/comments\/2" |
| 4258 | "href": "http://example.org/?rest_route=/wp/v2/comments/2" |
4259 | 4259 | } |
4260 | 4260 | ], |
4261 | 4261 | "collection": [ |
4262 | 4262 | { |
4263 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/comments" |
| 4263 | "href": "http://example.org/?rest_route=/wp/v2/comments" |
4264 | 4264 | } |
4265 | 4265 | ], |
4266 | 4266 | "up": [ |
4267 | 4267 | { |
4268 | 4268 | "embeddable": true, |
4269 | 4269 | "post_type": "post", |
4270 | | "href": "http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3" |
| 4270 | "href": "http://example.org/?rest_route=/wp/v2/posts/3" |
4271 | 4271 | } |
4272 | 4272 | ] |
4273 | 4273 | } |
… |
… |
mockedApiResponse.CommentModel = { |
4285 | 4285 | mockedApiResponse.settings = { |
4286 | 4286 | "title": "Test Blog", |
4287 | 4287 | "description": "Just another WordPress site", |
4288 | | "url": "http:\/\/example.org", |
| 4288 | "url": "http://example.org", |
4289 | 4289 | "email": "admin@example.org", |
4290 | 4290 | "timezone": "", |
4291 | 4291 | "date_format": "F j, Y", |