- Timestamp:
- 06/10/2021 07:18:15 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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',
Note: See TracChangeset
for help on using the changeset viewer.