Ticket #41123: 41123.2.diff
File 41123.2.diff, 12.0 KB (added by , 7 years ago) |
---|
-
tests/phpunit/tests/rest-api/rest-schema-setup.php
diff --git a/tests/phpunit/tests/rest-api/rest-schema-setup.php b/tests/phpunit/tests/rest-api/rest-schema-setup.php index b1fd17c..ec31010 100644
a b class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase { 375 375 /** 376 376 * This array contains normalized versions of object IDs and other values 377 377 * that can change depending on how PHPUnit is executed. For details on 378 * how they were generated, see # 39264.378 * how they were generated, see #41123. 379 379 */ 380 380 private static $fixture_replacements = array( 381 'oembeds.html' => '<blockquote class="wp-embedded-content">...</blockquote>', 381 'Schema.name' => 'Test Blog', 382 'Schema.url' => 'http://example.org', 383 'Schema.home' => 'http://example.org', 384 'Schema.routes./._links.self' => 'http://example.org/?rest_route=/', 385 'Schema.routes./oembed/1.0._links.self' => 'http://example.org/?rest_route=/oembed/1.0', 386 'Schema.routes./oembed/1.0/embed._links.self' => 'http://example.org/?rest_route=/oembed/1.0/embed', 387 'Schema.routes./oembed/1.0/proxy._links.self' => 'http://example.org/?rest_route=/oembed/1.0/proxy', 388 'Schema.routes./wp/v2._links.self' => 'http://example.org/?rest_route=/wp/v2', 389 'Schema.routes./wp/v2/posts._links.self' => 'http://example.org/?rest_route=/wp/v2/posts', 390 'Schema.routes./wp/v2/pages._links.self' => 'http://example.org/?rest_route=/wp/v2/pages', 391 'Schema.routes./wp/v2/media._links.self' => 'http://example.org/?rest_route=/wp/v2/media', 392 'Schema.routes./wp/v2/types._links.self' => 'http://example.org/?rest_route=/wp/v2/types', 393 'Schema.routes./wp/v2/statuses._links.self' => 'http://example.org/?rest_route=/wp/v2/statuses', 394 'Schema.routes./wp/v2/taxonomies._links.self' => 'http://example.org/?rest_route=/wp/v2/taxonomies', 395 'Schema.routes./wp/v2/categories._links.self' => 'http://example.org/?rest_route=/wp/v2/categories', 396 'Schema.routes./wp/v2/tags._links.self' => 'http://example.org/?rest_route=/wp/v2/tags', 397 'Schema.routes./wp/v2/users._links.self' => 'http://example.org/?rest_route=/wp/v2/users', 398 'Schema.routes./wp/v2/users/me._links.self' => 'http://example.org/?rest_route=/wp/v2/users/me', 399 'Schema.routes./wp/v2/comments._links.self' => 'http://example.org/?rest_route=/wp/v2/comments', 400 'Schema.routes./wp/v2/settings._links.self' => 'http://example.org/?rest_route=/wp/v2/settings', 401 'oembed.routes./oembed/1.0._links.self' => 'http://example.org/?rest_route=/oembed/1.0', 402 'oembed.routes./oembed/1.0/embed._links.self' => 'http://example.org/?rest_route=/oembed/1.0/embed', 403 'oembed.routes./oembed/1.0/proxy._links.self' => 'http://example.org/?rest_route=/oembed/1.0/proxy', 404 'oembeds.provider_name' => 'Test Blog', 405 'oembeds.provider_url' => 'http://example.org', 406 'oembeds.author_name' => 'Test Blog', 407 'oembeds.author_url' => 'http://example.org', 408 'oembeds.html' => '<blockquote class="wp-embedded-content">...</blockquote>...', 382 409 'PostsCollection.0.id' => 3, 383 410 'PostsCollection.0.guid.rendered' => 'http://example.org/?p=3', 384 411 'PostsCollection.0.link' => 'http://example.org/?p=3', 385 412 'PostsCollection.0._links.self.0.href' => 'http://example.org/?rest_route=/wp/v2/posts/3', 413 'PostsCollection.0._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/posts', 414 'PostsCollection.0._links.about.0.href' => 'http://example.org/?rest_route=/wp/v2/types/post', 386 415 'PostsCollection.0._links.replies.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fcomments&post=3', 387 416 'PostsCollection.0._links.version-history.0.href' => 'http://example.org/?rest_route=/wp/v2/posts/3/revisions', 388 417 'PostsCollection.0._links.wp:attachment.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3', … … class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase { 406 435 'PagesCollection.0.guid.rendered' => 'http://example.org/?page_id=5', 407 436 'PagesCollection.0.link' => 'http://example.org/?page_id=5', 408 437 'PagesCollection.0._links.self.0.href' => 'http://example.org/?rest_route=/wp/v2/pages/5', 438 'PagesCollection.0._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/pages', 439 'PagesCollection.0._links.about.0.href' => 'http://example.org/?rest_route=/wp/v2/types/page', 409 440 'PagesCollection.0._links.replies.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fcomments&post=5', 410 441 'PagesCollection.0._links.version-history.0.href' => 'http://example.org/?rest_route=/wp/v2/pages/5/revisions', 411 442 'PagesCollection.0._links.wp:attachment.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5', … … class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase { 426 457 'MediaCollection.0.id' => 7, 427 458 'MediaCollection.0.guid.rendered' => 'http://example.org/?attachment_id=7', 428 459 'MediaCollection.0.link' => 'http://example.org/?attachment_id=7', 460 'MediaCollection.0.description.rendered' => '<p class="attachment"><!-- <a...><img.../></a> --></p>', 461 'MediaCollection.0.source_url' => 'http://example.org/wp-content/uploads//tmp/canola.jpg', 429 462 'MediaCollection.0._links.self.0.href' => 'http://example.org/?rest_route=/wp/v2/media/7', 463 'MediaCollection.0._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/media', 464 'MediaCollection.0._links.about.0.href' => 'http://example.org/?rest_route=/wp/v2/types/attachment', 430 465 'MediaCollection.0._links.replies.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fcomments&post=7', 431 466 'MediaModel.id' => 7, 432 467 'MediaModel.guid.rendered' => 'http://example.org/?attachment_id=7', 433 468 'MediaModel.link' => 'http://example.org/?attachment_id=7', 469 'MediaModel.description.rendered' => '<p class="attachment"><!-- <a...><img.../></a> --></p>', 470 'MediaModel.source_url' => 'http://example.org/wp-content/uploads//tmp/canola.jpg', 471 'TypesCollection.post._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/types', 472 'TypesCollection.post._links.wp:items.0.href' => 'http://example.org/?rest_route=/wp/v2/posts', 473 'TypesCollection.page._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/types', 474 'TypesCollection.page._links.wp:items.0.href' => 'http://example.org/?rest_route=/wp/v2/pages', 475 'TypesCollection.attachment._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/types', 476 'TypesCollection.attachment._links.wp:items.0.href' => 'http://example.org/?rest_route=/wp/v2/media', 477 'StatusesCollection.publish._links.archives.0.href' => 'http://example.org/?rest_route=/wp/v2/posts', 478 'StatusesCollection.future._links.archives.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&status=future', 479 'StatusesCollection.draft._links.archives.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&status=draft', 480 'StatusesCollection.pending._links.archives.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&status=pending', 481 'StatusesCollection.private._links.archives.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&status=private', 482 'StatusesCollection.trash._links.archives.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&status=trash', 483 'TaxonomiesCollection.category._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/taxonomies', 484 'TaxonomiesCollection.category._links.wp:items.0.href' => 'http://example.org/?rest_route=/wp/v2/categories', 485 'TaxonomiesCollection.post_tag._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/taxonomies', 486 'TaxonomiesCollection.post_tag._links.wp:items.0.href' => 'http://example.org/?rest_route=/wp/v2/tags', 487 'CategoriesCollection.0.link' => 'http://example.org/?cat=1', 488 'CategoriesCollection.0._links.self.0.href' => 'http://example.org/?rest_route=/wp/v2/categories/1', 489 'CategoriesCollection.0._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/categories', 490 'CategoriesCollection.0._links.about.0.href' => 'http://example.org/?rest_route=/wp/v2/taxonomies/category', 491 'CategoriesCollection.0._links.wp:post_type.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&categories=1', 492 'CategoryModel.link' => 'http://example.org/?cat=1', 434 493 'TagsCollection.0.id' => 2, 494 'TagsCollection.0.link' => 'http://example.org/?tag=restapi-client-fixture-tag', 435 495 'TagsCollection.0._links.self.0.href' => 'http://example.org/?rest_route=/wp/v2/tags/2', 496 'TagsCollection.0._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/tags', 497 'TagsCollection.0._links.about.0.href' => 'http://example.org/?rest_route=/wp/v2/taxonomies/post_tag', 436 498 'TagsCollection.0._links.wp:post_type.0.href' => 'http://example.org/?rest_route=%2Fwp%2Fv2%2Fposts&tags=2', 437 499 'TagModel.id' => 2, 500 'TagModel.link' => 'http://example.org/?tag=restapi-client-fixture-tag', 501 'UsersCollection.0.link' => 'http://example.org/?author=1', 502 'UsersCollection.0.avatar_urls.24' => 'http://0.gravatar.com/avatar/96614ec98aa0c0d2ee75796dced6df54?s=24&d=mm&r=g', 503 'UsersCollection.0.avatar_urls.48' => 'http://0.gravatar.com/avatar/96614ec98aa0c0d2ee75796dced6df54?s=48&d=mm&r=g', 504 'UsersCollection.0.avatar_urls.96' => 'http://0.gravatar.com/avatar/96614ec98aa0c0d2ee75796dced6df54?s=96&d=mm&r=g', 505 'UsersCollection.0._links.self.0.href' => 'http://example.org/?rest_route=/wp/v2/users/1', 506 'UsersCollection.0._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/users', 438 507 'UsersCollection.1.id' => 2, 439 508 'UsersCollection.1.link' => 'http://example.org/?author=2', 440 509 'UsersCollection.1._links.self.0.href' => 'http://example.org/?rest_route=/wp/v2/users/2', 510 'UsersCollection.1._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/users', 441 511 'UserModel.id' => 2, 442 512 'UserModel.link' => 'http://example.org/?author=2', 443 513 'me.id' => 2, … … class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase { 446 516 'CommentsCollection.0.post' => 3, 447 517 'CommentsCollection.0.link' => 'http://example.org/?p=3#comment-2', 448 518 'CommentsCollection.0._links.self.0.href' => 'http://example.org/?rest_route=/wp/v2/comments/2', 519 'CommentsCollection.0._links.collection.0.href' => 'http://example.org/?rest_route=/wp/v2/comments', 449 520 'CommentsCollection.0._links.up.0.href' => 'http://example.org/?rest_route=/wp/v2/posts/3', 450 521 'CommentModel.id' => 2, 451 522 'CommentModel.post' => 3, 452 523 'CommentModel.link' => 'http://example.org/?p=3#comment-2', 524 'settings.title' => 'Test Blog', 525 'settings.url' => 'http://example.org', 526 'settings.email' => 'admin@example.org', 453 527 ); 454 528 455 529 private function normalize_fixture( $data, $path ) { -
tests/qunit/fixtures/wp-api-generated.js
diff --git a/tests/qunit/fixtures/wp-api-generated.js b/tests/qunit/fixtures/wp-api-generated.js index 69e2375..ecfc346 100644
a b mockedApiResponse.oembeds = { 3510 3510 "type": "rich", 3511 3511 "width": 600, 3512 3512 "height": 338, 3513 "html": "<blockquote class=\"wp-embedded-content\">...</blockquote> "3513 "html": "<blockquote class=\"wp-embedded-content\">...</blockquote>..." 3514 3514 }; 3515 3515 3516 3516 mockedApiResponse.oembedProxy = { … … mockedApiResponse.MediaCollection = [ 3901 3901 "template": "", 3902 3902 "meta": [], 3903 3903 "description": { 3904 "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"3904 "rendered": "<p class=\"attachment\"><!-- <a...><img.../></a> --></p>" 3905 3905 }, 3906 3906 "caption": { 3907 3907 "rendered": "<p>A sample caption</p>\n" … … mockedApiResponse.MediaModel = { 3960 3960 "template": "", 3961 3961 "meta": [], 3962 3962 "description": { 3963 "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"3963 "rendered": "<p class=\"attachment\"><!-- <a...><img.../></a> --></p>" 3964 3964 }, 3965 3965 "caption": { 3966 3966 "rendered": "<p>A sample caption</p>\n"