REST API: Regenerate fixure schema after introduction of new endpoints.

This fixture schema ensures `wp-api-generated.js` doesn't change when running tests in local dev environments.

Merges [43851] from the 5.0 branch to trunk. `wp-api-generated.js` generated based on current trunk.
Props danielbachhuber.
Fixes #45196.


git-svn-id: https://develop.svn.wordpress.org/trunk@44217 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt
2018-12-16 01:37:56 +00:00
parent 1e476cf34d
commit de92919e02
2 changed files with 155 additions and 102 deletions
@@ -476,6 +476,7 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
'Schema.routes./wp/v2/posts._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/posts',
'Schema.routes./wp/v2/pages._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/pages',
'Schema.routes./wp/v2/media._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/media',
'Schema.routes./wp/v2/blocks._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/blocks',
'Schema.routes./wp/v2/types._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/types',
'Schema.routes./wp/v2/statuses._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/statuses',
'Schema.routes./wp/v2/taxonomies._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/taxonomies',
@@ -484,7 +485,9 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
'Schema.routes./wp/v2/users._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/users',
'Schema.routes./wp/v2/users/me._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/users/me',
'Schema.routes./wp/v2/comments._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/comments',
'Schema.routes./wp/v2/search._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/search',
'Schema.routes./wp/v2/settings._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/settings',
'Schema.routes./wp/v2/themes._links.self' => 'http://example.org/index.php?rest_route=/wp/v2/themes',
'oembed.routes./oembed/1.0._links.self' => 'http://example.org/index.php?rest_route=/oembed/1.0',
'oembed.routes./oembed/1.0/embed._links.self' => 'http://example.org/index.php?rest_route=/oembed/1.0/embed',
'oembed.routes./oembed/1.0/proxy._links.self' => 'http://example.org/index.php?rest_route=/oembed/1.0/proxy',
@@ -501,8 +504,8 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
'PostsCollection.0._links.about.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/types/post',
'PostsCollection.0._links.replies.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4',
'PostsCollection.0._links.version-history.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/posts/4/revisions',
'PostsCollection.0._links.predecessor-version.0.id' => 5,
'PostsCollection.0._links.predecessor-version.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/posts/4/revisions/5',
'PostsCollection.0._links.predecessor-version.0.id' => 6,
'PostsCollection.0._links.predecessor-version.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/posts/4/revisions/6',
'PostsCollection.0._links.wp:attachment.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4',
'PostsCollection.0._links.wp:term.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4',
'PostsCollection.0._links.wp:term.1.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4',
@@ -510,53 +513,87 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
'PostModel.guid.rendered' => 'http://example.org/?p=4',
'PostModel.link' => 'http://example.org/?p=4',
'postRevisions.0.author' => 2,
'postRevisions.0.id' => 5,
'postRevisions.0.id' => 6,
'postRevisions.0.parent' => 4,
'postRevisions.0.slug' => '4-revision-v1',
'postRevisions.0.guid.rendered' => 'http://example.org/?p=5',
'postRevisions.0.slug' => '4-autosave-v1',
'postRevisions.0.guid.rendered' => 'http://example.org/?p=6',
'postRevisions.0._links.parent.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/posts/4',
'postRevisions.1.author' => 2,
'postRevisions.1.id' => 5,
'postRevisions.1.parent' => 4,
'postRevisions.1.slug' => '4-revision-v1',
'postRevisions.1.guid.rendered' => 'http://example.org/?p=5',
'postRevisions.1._links.parent.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/posts/4',
'revision.author' => 2,
'revision.id' => 5,
'revision.parent' => 4,
'revision.slug' => '4-revision-v1',
'revision.guid.rendered' => 'http://example.org/?p=5',
'PagesCollection.0.id' => 6,
'PagesCollection.0.guid.rendered' => 'http://example.org/?page_id=6',
'PagesCollection.0.link' => 'http://example.org/?page_id=6',
'PagesCollection.0._links.self.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages/6',
'postAutosaves.0.author' => 2,
'postAutosaves.0.id' => 6,
'postAutosaves.0.parent' => 4,
'postAutosaves.0.slug' => '4-autosave-v1',
'postAutosaves.0.guid.rendered' => 'http://example.org/?p=6',
'postAutosaves.0._links.parent.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/posts/4',
'autosave.author' => 2,
'autosave.id' => 6,
'autosave.parent' => 4,
'autosave.slug' => '4-autosave-v1',
'autosave.guid.rendered' => 'http://example.org/?p=6',
'PagesCollection.0.id' => 7,
'PagesCollection.0.guid.rendered' => 'http://example.org/?page_id=7',
'PagesCollection.0.link' => 'http://example.org/?page_id=7',
'PagesCollection.0._links.self.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages/7',
'PagesCollection.0._links.collection.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages',
'PagesCollection.0._links.about.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/types/page',
'PagesCollection.0._links.replies.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6',
'PagesCollection.0._links.version-history.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages/6/revisions',
'PagesCollection.0._links.predecessor-version.0.id' => 7,
'PagesCollection.0._links.predecessor-version.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages/6/revisions/7',
'PagesCollection.0._links.wp:attachment.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6',
'PageModel.id' => 6,
'PageModel.guid.rendered' => 'http://example.org/?page_id=6',
'PageModel.link' => 'http://example.org/?page_id=6',
'PagesCollection.0._links.replies.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7',
'PagesCollection.0._links.version-history.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages/7/revisions',
'PagesCollection.0._links.predecessor-version.0.id' => 9,
'PagesCollection.0._links.predecessor-version.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages/7/revisions/9',
'PagesCollection.0._links.wp:attachment.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7',
'PageModel.id' => 7,
'PageModel.guid.rendered' => 'http://example.org/?page_id=7',
'PageModel.link' => 'http://example.org/?page_id=7',
'pageRevisions.0.author' => 2,
'pageRevisions.0.id' => 7,
'pageRevisions.0.parent' => 6,
'pageRevisions.0.slug' => '6-revision-v1',
'pageRevisions.0.guid.rendered' => 'http://example.org/?p=7',
'pageRevisions.0._links.parent.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages/6',
'pageRevisions.0.id' => 9,
'pageRevisions.0.parent' => 7,
'pageRevisions.0.slug' => '7-autosave-v1',
'pageRevisions.0.guid.rendered' => 'http://example.org/?p=9',
'pageRevisions.0._links.parent.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages/7',
'pageRevisions.1.author' => 2,
'pageRevisions.1.id' => 8,
'pageRevisions.1.parent' => 7,
'pageRevisions.1.slug' => '7-revision-v1',
'pageRevisions.1.guid.rendered' => 'http://example.org/?p=8',
'pageRevisions.1._links.parent.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages/7',
'pageRevision.author' => 2,
'pageRevision.id' => 7,
'pageRevision.parent' => 6,
'pageRevision.slug' => '6-revision-v1',
'pageRevision.guid.rendered' => 'http://example.org/?p=7',
'MediaCollection.0.id' => 8,
'MediaCollection.0.guid.rendered' => 'http://example.org/?attachment_id=8',
'MediaCollection.0.link' => 'http://example.org/?attachment_id=8',
'pageRevision.id' => 8,
'pageRevision.parent' => 7,
'pageRevision.slug' => '7-revision-v1',
'pageRevision.guid.rendered' => 'http://example.org/?p=8',
'pageAutosaves.0.author' => 2,
'pageAutosaves.0.id' => 9,
'pageAutosaves.0.parent' => 7,
'pageAutosaves.0.slug' => '7-autosave-v1',
'pageAutosaves.0.guid.rendered' => 'http://example.org/?p=9',
'pageAutosaves.0._links.parent.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages/7',
'pageAutosave.author' => 2,
'pageAutosave.id' => 9,
'pageAutosave.parent' => 7,
'pageAutosave.slug' => '7-autosave-v1',
'pageAutosave.guid.rendered' => 'http://example.org/?p=9',
'MediaCollection.0.id' => 10,
'MediaCollection.0.guid.rendered' => 'http://example.org/?attachment_id=10',
'MediaCollection.0.link' => 'http://example.org/?attachment_id=10',
'MediaCollection.0.description.rendered' => '<p class="attachment"><!-- <a...><img.../></a> --></p>',
'MediaCollection.0.source_url' => 'http://example.org/wp-content/uploads//tmp/canola.jpg',
'MediaCollection.0._links.self.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/media/8',
'MediaCollection.0._links.self.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/media/10',
'MediaCollection.0._links.collection.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/media',
'MediaCollection.0._links.about.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/types/attachment',
'MediaCollection.0._links.replies.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8',
'MediaModel.id' => 8,
'MediaModel.guid.rendered' => 'http://example.org/?attachment_id=8',
'MediaModel.link' => 'http://example.org/?attachment_id=8',
'MediaCollection.0._links.replies.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10',
'MediaModel.id' => 10,
'MediaModel.guid.rendered' => 'http://example.org/?attachment_id=10',
'MediaModel.link' => 'http://example.org/?attachment_id=10',
'MediaModel.description.rendered' => '<p class="attachment"><!-- <a...><img.../></a> --></p>',
'MediaModel.source_url' => 'http://example.org/wp-content/uploads//tmp/canola.jpg',
'TypesCollection.post._links.collection.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/types',
@@ -565,6 +602,8 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
'TypesCollection.page._links.wp:items.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages',
'TypesCollection.attachment._links.collection.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/types',
'TypesCollection.attachment._links.wp:items.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/media',
'TypesCollection.wp_block._links.collection.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/types',
'TypesCollection.wp_block._links.wp:items.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/blocks',
'StatusesCollection.publish._links.archives.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/posts',
'StatusesCollection.future._links.archives.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fposts&status=future',
'StatusesCollection.draft._links.archives.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fposts&status=draft',
@@ -576,19 +615,33 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
'TaxonomiesCollection.post_tag._links.collection.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/taxonomies',
'TaxonomiesCollection.post_tag._links.wp:items.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/tags',
'CategoriesCollection.0.link' => 'http://example.org/?cat=1',
'CategoriesCollection.0.meta.test_single' => '',
'CategoriesCollection.0.meta.test_multi' => [],
'CategoriesCollection.0.meta.test_cat_single' => '',
'CategoriesCollection.0.meta.test_cat_multi' => [],
'CategoriesCollection.0._links.self.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/categories/1',
'CategoriesCollection.0._links.collection.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/categories',
'CategoriesCollection.0._links.about.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/taxonomies/category',
'CategoriesCollection.0._links.wp:post_type.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fposts&categories=1',
'CategoryModel.link' => 'http://example.org/?cat=1',
'CategoryModel.meta.test_single' => '',
'CategoryModel.meta.test_multi' => [],
'CategoryModel.meta.test_cat_single' => '',
'CategoryModel.meta.test_cat_multi' => [],
'TagsCollection.0.id' => 2,
'TagsCollection.0.link' => 'http://example.org/?tag=restapi-client-fixture-tag',
'TagsCollection.0.meta.test_single' => '',
'TagsCollection.0.meta.test_multi' => [],
'TagsCollection.0.meta.test_tag_meta' => '',
'TagsCollection.0._links.self.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/tags/2',
'TagsCollection.0._links.collection.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/tags',
'TagsCollection.0._links.about.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/taxonomies/post_tag',
'TagsCollection.0._links.wp:post_type.0.href' => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fposts&tags=2',
'TagModel.id' => 2,
'TagModel.link' => 'http://example.org/?tag=restapi-client-fixture-tag',
'TagModel.meta.test_single' => '',
'TagModel.meta.test_multi' => [],
'TagModel.meta.test_tag_meta' => '',
'UsersCollection.0.link' => 'http://example.org/?author=1',
'UsersCollection.0.avatar_urls.24' => 'http://0.gravatar.com/avatar/96614ec98aa0c0d2ee75796dced6df54?s=24&d=mm&r=g',
'UsersCollection.0.avatar_urls.48' => 'http://0.gravatar.com/avatar/96614ec98aa0c0d2ee75796dced6df54?s=48&d=mm&r=g',