Changeset 51137
- Timestamp:
- 06/10/2021 07:18:15 PM (4 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r51026 r51137 1156 1156 $data = $response->get_data(); 1157 1157 1158 $this->assert EqualSets( $post_ids, array_column( $data, 'id' ) );1158 $this->assertSameSets( $post_ids, array_column( $data, 'id' ) ); 1159 1159 } 1160 1160 -
trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php
r50491 r51137 220 220 'version', 221 221 ); 222 $this->assert EqualSets( $fields, array_keys( $data[0] ) );222 $this->assertSameSets( $fields, array_keys( $data[0] ) ); 223 223 224 224 $this->assertContains( 'twentytwenty', wp_list_pluck( $data, 'stylesheet' ) ); … … 1237 1237 $fields_links = array( 'collection', 'self' ); 1238 1238 1239 $this->assert EqualSets( $fields, array_keys( $data ) );1240 $this->assert EqualSets( $fields_links, array_keys( $links ) );1239 $this->assertSameSets( $fields, array_keys( $data ) ); 1240 $this->assertSameSets( $fields_links, array_keys( $links ) ); 1241 1241 } 1242 1242 -
trunk/tests/phpunit/tests/rest-api/rest-widget-types-controller.php
r51135 r51137 403 403 $data['preview'] 404 404 ); 405 $this->assert EqualSets(405 $this->assertSameSets( 406 406 array( 407 407 'encoded' => base64_encode( serialize( array( 'title' => 'Test title' ) ) ), … … 439 439 $data['preview'] 440 440 ); 441 $this->assert EqualSets(441 $this->assertSameSets( 442 442 array( 443 443 'encoded' => base64_encode( serialize( array( 'title' => 'Updated title' ) ) ), … … 483 483 $data['preview'] 484 484 ); 485 $this->assert EqualSets(485 $this->assertSameSets( 486 486 array( 487 487 'encoded' => base64_encode( serialize( array( 'title' => 'Test title' ) ) ), -
trunk/tests/phpunit/tests/rest-api/rest-widgets-controller.php
r51135 r51137 273 273 $data = $response->get_data(); 274 274 $data = $this->remove_links( $data ); 275 $this->assert EqualSets(275 $this->assertSameSets( 276 276 array( 277 277 array( … … 279 279 'id_base' => 'block', 280 280 'sidebar' => 'sidebar-1', 281 'rendered' => '<p>Block test</p>', 281 282 'instance' => array( 282 283 'encoded' => base64_encode( … … 298 299 ), 299 300 ), 300 'rendered' => '<p>Block test</p>',301 301 ), 302 302 array( … … 304 304 'id_base' => 'rss', 305 305 'sidebar' => 'sidebar-1', 306 'rendered' => '<a class="rsswidget" href="https://wordpress.org/news/feed"><img class="rss-widget-icon" style="border:0" width="14" height="14" src="http://example.org/wp-includes/images/rss.png" alt="RSS" /></a> <a class="rsswidget" href="https://wordpress.org/news">RSS test</a><ul><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/12/introducing-learn-wordpress/\'>Introducing Learn WordPress</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/12/simone/\'>WordPress 5.6 “Simone”</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/12/state-of-the-word-2020/\'>State of the Word 2020</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/12/the-month-in-wordpress-november-2020/\'>The Month in WordPress: November 2020</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/12/wordpress-5-6-release-candidate-2/\'>WordPress 5.6 Release Candidate 2</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/11/wordpress-5-6-release-candidate/\'>WordPress 5.6 Release Candidate</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/11/wordpress-5-6-beta-4/\'>WordPress 5.6 Beta 4</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/11/wordpress-5-6-beta-3/\'>WordPress 5.6 Beta 3</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/11/the-month-in-wordpress-october-2020/\'>The Month in WordPress: October 2020</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/10/wordpress-5-5-3-maintenance-release/\'>WordPress 5.5.3 Maintenance Release</a></li></ul>', 306 307 'instance' => array( 307 308 'encoded' => base64_encode( … … 322 323 ), 323 324 ), 324 'rendered' => '<a class="rsswidget" href="https://wordpress.org/news/feed"><img class="rss-widget-icon" style="border:0" width="14" height="14" src="http://example.org/wp-includes/images/rss.png" alt="RSS" /></a> <a class="rsswidget" href="https://wordpress.org/news">RSS test</a><ul><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/12/introducing-learn-wordpress/\'>Introducing Learn WordPress</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/12/simone/\'>WordPress 5.6 “Simone”</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/12/state-of-the-word-2020/\'>State of the Word 2020</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/12/the-month-in-wordpress-november-2020/\'>The Month in WordPress: November 2020</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/12/wordpress-5-6-release-candidate-2/\'>WordPress 5.6 Release Candidate 2</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/11/wordpress-5-6-release-candidate/\'>WordPress 5.6 Release Candidate</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/11/wordpress-5-6-beta-4/\'>WordPress 5.6 Beta 4</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/11/wordpress-5-6-beta-3/\'>WordPress 5.6 Beta 3</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/11/the-month-in-wordpress-october-2020/\'>The Month in WordPress: October 2020</a></li><li><a class=\'rsswidget\' href=\'https://wordpress.org/news/2020/10/wordpress-5-5-3-maintenance-release/\'>WordPress 5.5.3 Maintenance Release</a></li></ul>',325 325 ), 326 326 array( … … 328 328 'id_base' => 'testwidget', 329 329 'sidebar' => 'sidebar-1', 330 'rendered' => '<h1>Default id</h1><span>Default text</span>', 330 331 'instance' => null, 331 'rendered' => '<h1>Default id</h1><span>Default text</span>',332 332 ), 333 333 ), … … 448 448 $response = rest_get_server()->dispatch( $request ); 449 449 $data = $response->get_data(); 450 $this->assert EqualSets(450 $this->assertSameSets( 451 451 array( 452 452 'id' => 'text-1', 453 453 'id_base' => 'text', 454 454 'sidebar' => 'sidebar-1', 455 'rendered' => '<div class="textwidget">Custom text test</div>', 455 456 'instance' => array( 456 457 'encoded' => base64_encode( … … 472 473 ), 473 474 ), 474 'rendered' => '<div class="textwidget">Custom text test</div>',475 475 ), 476 476 $data … … 566 566 $this->assertSame( 'text-2', $data['id'] ); 567 567 $this->assertSame( 'sidebar-1', $data['sidebar'] ); 568 $this->assert EqualSets(568 $this->assertSameSetsWithIndex( 569 569 array( 570 570 'text' => 'Updated text test', … … 658 658 $this->assertSame( 'block-7', $data['id'] ); 659 659 $this->assertSame( 'sidebar-1', $data['sidebar'] ); 660 $this->assert EqualSets(660 $this->assertSameSets( 661 661 array( 662 662 'content' => '<!-- wp:paragraph --><p>Block test</p><!-- /wp:paragraph -->', … … 722 722 $this->assertSame( 'text-2', $data['id'] ); 723 723 $this->assertSame( 'sidebar-1', $data['sidebar'] ); 724 $this->assert EqualSets(724 $this->assertSameSetsWithIndex( 725 725 array( 726 726 'text' => 'Updated text test', … … 757 757 $this->assertSame( 'text-2', $data['id'] ); 758 758 $this->assertSame( 'sidebar-1', $data['sidebar'] ); 759 $this->assert EqualSets(759 $this->assertSameSetsWithIndex( 760 760 array( 761 761 'text' => 'Text 1', … … 780 780 $this->assertSame( 'text-3', $data['id'] ); 781 781 $this->assertSame( 'sidebar-1', $data['sidebar'] ); 782 $this->assert EqualSets(782 $this->assertSameSetsWithIndex( 783 783 array( 784 784 'text' => 'Text 2', … … 828 828 $this->assertSame( 'text-2', $data['id'] ); 829 829 $this->assertSame( 'sidebar-1', $data['sidebar'] ); 830 $this->assert EqualSets(830 $this->assertSameSetsWithIndex( 831 831 array( 832 832 'text' => 'Updated text test', … … 875 875 $this->assertSame( 'text-1', $data['id'] ); 876 876 $this->assertSame( 'sidebar-1', $data['sidebar'] ); 877 $this->assert EqualSets(877 $this->assertSameSetsWithIndex( 878 878 array( 879 879 'text' => 'Updated text test', … … 964 964 $this->assertSame( 'text-1', $data['id'] ); 965 965 $this->assertSame( 'sidebar-1', $data['sidebar'] ); 966 $this->assert EqualSets(966 $this->assertSameSetsWithIndex( 967 967 array( 968 968 'text' => 'Updated text test', … … 1171 1171 $data = $response->get_data(); 1172 1172 1173 $this->assert EqualSets(1173 $this->assertSameSetsWithIndex( 1174 1174 array( 1175 1175 'text' => 'Updated \\" \\\' text test', -
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r51079 r51137 62 62 ); 63 63 64 $this->assert EqualSetsWithIndex( $expected, $actual );64 $this->assertSameSetsWithIndex( $expected, $actual ); 65 65 } 66 66 … … 657 657 $actual = WP_Theme_JSON::get_from_editor_settings( array() ); 658 658 659 $this->assert EqualSetsWithIndex( $expected, $actual );659 $this->assertSameSetsWithIndex( $expected, $actual ); 660 660 } 661 661 … … 674 674 $actual = WP_Theme_JSON::get_from_editor_settings( $input ); 675 675 676 $this->assert EqualSetsWithIndex( $expected, $actual['settings']['spacing'] );676 $this->assertSameSetsWithIndex( $expected, $actual['settings']['spacing'] ); 677 677 } 678 678 … … 691 691 $actual = WP_Theme_JSON::get_from_editor_settings( $input ); 692 692 693 $this->assert EqualSetsWithIndex( $expected, $actual['settings']['spacing'] );693 $this->assertSameSetsWithIndex( $expected, $actual['settings']['spacing'] ); 694 694 } 695 695 … … 708 708 $actual = WP_Theme_JSON::get_from_editor_settings( $input ); 709 709 710 $this->assert EqualSetsWithIndex( $expected, $actual['settings']['spacing'] );710 $this->assertSameSetsWithIndex( $expected, $actual['settings']['spacing'] ); 711 711 } 712 712
Note: See TracChangeset
for help on using the changeset viewer.