Make WordPress Core


Ignore:
Timestamp:
07/13/2018 04:45:35 AM (7 years ago)
Author:
pento
Message:

REST API: Update the test fixture generator following [43439]

As [43439] added data that contains object IDs, it can cause wp-api-generated.js to be unnecessarily regenerated.

Regenerating our list of fixtures that need normalising rectifies this.

See #44321.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php

    r42741 r43441  
    442442        'oembeds.author_url'                               => 'http://example.org',
    443443        'oembeds.html'                                     => '<blockquote class="wp-embedded-content">...</blockquote>...',
    444         'PostsCollection.0.id'                             => 3,
    445         'PostsCollection.0.guid.rendered'                  => 'http://example.org/?p=3',
    446         'PostsCollection.0.link'                           => 'http://example.org/?p=3',
    447         'PostsCollection.0._links.self.0.href'             => 'http://example.org/index.php?rest_route=/wp/v2/posts/3',
     444        'PostsCollection.0.id'                             => 4,
     445        'PostsCollection.0.guid.rendered'                  => 'http://example.org/?p=4',
     446        'PostsCollection.0.link'                           => 'http://example.org/?p=4',
     447        'PostsCollection.0._links.self.0.href'             => 'http://example.org/index.php?rest_route=/wp/v2/posts/4',
    448448        'PostsCollection.0._links.collection.0.href'       => 'http://example.org/index.php?rest_route=/wp/v2/posts',
    449449        'PostsCollection.0._links.about.0.href'            => 'http://example.org/index.php?rest_route=/wp/v2/types/post',
    450         'PostsCollection.0._links.replies.0.href'          => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3',
    451         'PostsCollection.0._links.version-history.0.href'  => 'http://example.org/index.php?rest_route=/wp/v2/posts/3/revisions',
    452         'PostsCollection.0._links.wp:attachment.0.href'    => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3',
    453         'PostsCollection.0._links.wp:term.0.href'          => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3',
    454         'PostsCollection.0._links.wp:term.1.href'          => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3',
    455         'PostModel.id'                                     => 3,
    456         'PostModel.guid.rendered'                          => 'http://example.org/?p=3',
    457         'PostModel.link'                                   => 'http://example.org/?p=3',
     450        'PostsCollection.0._links.replies.0.href'          => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4',
     451        'PostsCollection.0._links.version-history.0.href'  => 'http://example.org/index.php?rest_route=/wp/v2/posts/4/revisions',
     452        'PostsCollection.0._links.predecessor-version.0.id' => 5,
     453        'PostsCollection.0._links.predecessor-version.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/posts/4/revisions/5',
     454        'PostsCollection.0._links.wp:attachment.0.href'    => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4',
     455        'PostsCollection.0._links.wp:term.0.href'          => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4',
     456        'PostsCollection.0._links.wp:term.1.href'          => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4',
     457        'PostModel.id'                                     => 4,
     458        'PostModel.guid.rendered'                          => 'http://example.org/?p=4',
     459        'PostModel.link'                                   => 'http://example.org/?p=4',
    458460        'postRevisions.0.author'                           => 2,
    459         'postRevisions.0.id'                               => 4,
    460         'postRevisions.0.parent'                           => 3,
    461         'postRevisions.0.slug'                             => '3-revision-v1',
    462         'postRevisions.0.guid.rendered'                    => 'http://example.org/?p=4',
    463         'postRevisions.0._links.parent.0.href'             => 'http://example.org/index.php?rest_route=/wp/v2/posts/3',
     461        'postRevisions.0.id'                               => 5,
     462        'postRevisions.0.parent'                           => 4,
     463        'postRevisions.0.slug'                             => '4-revision-v1',
     464        'postRevisions.0.guid.rendered'                    => 'http://example.org/?p=5',
     465        'postRevisions.0._links.parent.0.href'             => 'http://example.org/index.php?rest_route=/wp/v2/posts/4',
    464466        'revision.author'                                  => 2,
    465         'revision.id'                                      => 4,
    466         'revision.parent'                                  => 3,
    467         'revision.slug'                                    => '3-revision-v1',
    468         'revision.guid.rendered'                           => 'http://example.org/?p=4',
    469         'PagesCollection.0.id'                             => 5,
    470         'PagesCollection.0.guid.rendered'                  => 'http://example.org/?page_id=5',
    471         'PagesCollection.0.link'                           => 'http://example.org/?page_id=5',
    472         'PagesCollection.0._links.self.0.href'             => 'http://example.org/index.php?rest_route=/wp/v2/pages/5',
     467        'revision.id'                                      => 5,
     468        'revision.parent'                                  => 4,
     469        'revision.slug'                                    => '4-revision-v1',
     470        'revision.guid.rendered'                           => 'http://example.org/?p=5',
     471        'PagesCollection.0.id'                             => 6,
     472        'PagesCollection.0.guid.rendered'                  => 'http://example.org/?page_id=6',
     473        'PagesCollection.0.link'                           => 'http://example.org/?page_id=6',
     474        'PagesCollection.0._links.self.0.href'             => 'http://example.org/index.php?rest_route=/wp/v2/pages/6',
    473475        'PagesCollection.0._links.collection.0.href'       => 'http://example.org/index.php?rest_route=/wp/v2/pages',
    474476        'PagesCollection.0._links.about.0.href'            => 'http://example.org/index.php?rest_route=/wp/v2/types/page',
    475         'PagesCollection.0._links.replies.0.href'          => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5',
    476         'PagesCollection.0._links.version-history.0.href'  => 'http://example.org/index.php?rest_route=/wp/v2/pages/5/revisions',
    477         'PagesCollection.0._links.wp:attachment.0.href'    => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5',
    478         'PageModel.id'                                     => 5,
    479         'PageModel.guid.rendered'                          => 'http://example.org/?page_id=5',
    480         'PageModel.link'                                   => 'http://example.org/?page_id=5',
     477        'PagesCollection.0._links.replies.0.href'          => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6',
     478        'PagesCollection.0._links.version-history.0.href'  => 'http://example.org/index.php?rest_route=/wp/v2/pages/6/revisions',
     479        'PagesCollection.0._links.predecessor-version.0.id' => 7,
     480        'PagesCollection.0._links.predecessor-version.0.href' => 'http://example.org/index.php?rest_route=/wp/v2/pages/6/revisions/7',
     481        'PagesCollection.0._links.wp:attachment.0.href'    => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6',
     482        'PageModel.id'                                     => 6,
     483        'PageModel.guid.rendered'                          => 'http://example.org/?page_id=6',
     484        'PageModel.link'                                   => 'http://example.org/?page_id=6',
    481485        'pageRevisions.0.author'                           => 2,
    482         'pageRevisions.0.id'                               => 6,
    483         'pageRevisions.0.parent'                           => 5,
    484         'pageRevisions.0.slug'                             => '5-revision-v1',
    485         'pageRevisions.0.guid.rendered'                    => 'http://example.org/?p=6',
    486         'pageRevisions.0._links.parent.0.href'             => 'http://example.org/index.php?rest_route=/wp/v2/pages/5',
     486        'pageRevisions.0.id'                               => 7,
     487        'pageRevisions.0.parent'                           => 6,
     488        'pageRevisions.0.slug'                             => '6-revision-v1',
     489        'pageRevisions.0.guid.rendered'                    => 'http://example.org/?p=7',
     490        'pageRevisions.0._links.parent.0.href'             => 'http://example.org/index.php?rest_route=/wp/v2/pages/6',
    487491        'pageRevision.author'                              => 2,
    488         'pageRevision.id'                                  => 6,
    489         'pageRevision.parent'                              => 5,
    490         'pageRevision.slug'                                => '5-revision-v1',
    491         'pageRevision.guid.rendered'                       => 'http://example.org/?p=6',
    492         'MediaCollection.0.id'                             => 7,
    493         'MediaCollection.0.guid.rendered'                  => 'http://example.org/?attachment_id=7',
    494         'MediaCollection.0.link'                           => 'http://example.org/?attachment_id=7',
     492        'pageRevision.id'                                  => 7,
     493        'pageRevision.parent'                              => 6,
     494        'pageRevision.slug'                                => '6-revision-v1',
     495        'pageRevision.guid.rendered'                       => 'http://example.org/?p=7',
     496        'MediaCollection.0.id'                             => 8,
     497        'MediaCollection.0.guid.rendered'                  => 'http://example.org/?attachment_id=8',
     498        'MediaCollection.0.link'                           => 'http://example.org/?attachment_id=8',
    495499        'MediaCollection.0.description.rendered'           => '<p class="attachment"><!-- <a...><img.../></a> --></p>',
    496500        'MediaCollection.0.source_url'                     => 'http://example.org/wp-content/uploads//tmp/canola.jpg',
    497         'MediaCollection.0._links.self.0.href'             => 'http://example.org/index.php?rest_route=/wp/v2/media/7',
     501        'MediaCollection.0._links.self.0.href'             => 'http://example.org/index.php?rest_route=/wp/v2/media/8',
    498502        'MediaCollection.0._links.collection.0.href'       => 'http://example.org/index.php?rest_route=/wp/v2/media',
    499503        'MediaCollection.0._links.about.0.href'            => 'http://example.org/index.php?rest_route=/wp/v2/types/attachment',
    500         'MediaCollection.0._links.replies.0.href'          => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7',
    501         'MediaModel.id'                                    => 7,
    502         'MediaModel.guid.rendered'                         => 'http://example.org/?attachment_id=7',
    503         'MediaModel.link'                                  => 'http://example.org/?attachment_id=7',
     504        'MediaCollection.0._links.replies.0.href'          => 'http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8',
     505        'MediaModel.id'                                    => 8,
     506        'MediaModel.guid.rendered'                         => 'http://example.org/?attachment_id=8',
     507        'MediaModel.link'                                  => 'http://example.org/?attachment_id=8',
    504508        'MediaModel.description.rendered'                  => '<p class="attachment"><!-- <a...><img.../></a> --></p>',
    505509        'MediaModel.source_url'                            => 'http://example.org/wp-content/uploads//tmp/canola.jpg',
     
    549553        'me.link'                                          => 'http://example.org/?author=2',
    550554        'CommentsCollection.0.id'                          => 2,
    551         'CommentsCollection.0.post'                        => 3,
    552         'CommentsCollection.0.link'                        => 'http://example.org/?p=3#comment-2',
     555        'CommentsCollection.0.post'                        => 4,
     556        'CommentsCollection.0.link'                        => 'http://example.org/?p=4#comment-2',
    553557        'CommentsCollection.0._links.self.0.href'          => 'http://example.org/index.php?rest_route=/wp/v2/comments/2',
    554558        'CommentsCollection.0._links.collection.0.href'    => 'http://example.org/index.php?rest_route=/wp/v2/comments',
    555         'CommentsCollection.0._links.up.0.href'            => 'http://example.org/index.php?rest_route=/wp/v2/posts/3',
     559        'CommentsCollection.0._links.up.0.href'            => 'http://example.org/index.php?rest_route=/wp/v2/posts/4',
    556560        'CommentModel.id'                                  => 2,
    557         'CommentModel.post'                                => 3,
    558         'CommentModel.link'                                => 'http://example.org/?p=3#comment-2',
     561        'CommentModel.post'                                => 4,
     562        'CommentModel.link'                                => 'http://example.org/?p=4#comment-2',
    559563        'settings.title'                                   => 'Test Blog',
    560564        'settings.url'                                     => 'http://example.org',
Note: See TracChangeset for help on using the changeset viewer.