- Timestamp:
- 07/12/2021 07:02:53 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-sidebars-controller.php
r51377 r51408 314 314 315 315 /** 316 * @ticket 53646 317 */ 318 public function test_get_items_when_descriptions_have_markup() { 319 register_sidebar( 320 array( 321 'name' => 'New Sidebar', 322 'id' => 'new-sidebar', 323 'description' => '<iframe></iframe>This is a <b>description</b> with some <a href="#">markup</a>.<script></script>', 324 'before_widget' => '', 325 'after_widget' => '', 326 'before_title' => '', 327 'after_title' => '', 328 ) 329 ); 330 331 $request = new WP_REST_Request( 'GET', '/wp/v2/sidebars' ); 332 $response = rest_get_server()->dispatch( $request ); 333 $data = $response->get_data(); 334 $data = $this->remove_links( $data ); 335 $this->assertSame( 336 array( 337 array( 338 'id' => 'wp_inactive_widgets', 339 'name' => 'Inactive widgets', 340 'description' => '', 341 'class' => '', 342 'before_widget' => '', 343 'after_widget' => '', 344 'before_title' => '', 345 'after_title' => '', 346 'status' => 'inactive', 347 'widgets' => array(), 348 ), 349 array( 350 'id' => 'new-sidebar', 351 'name' => 'New Sidebar', 352 'description' => 'This is a <b>description</b> with some <a href="#">markup</a>.', 353 'class' => '', 354 'before_widget' => '', 355 'after_widget' => '', 356 'before_title' => '', 357 'after_title' => '', 358 'status' => 'active', 359 'widgets' => array(), 360 ), 361 ), 362 $data 363 ); 364 } 365 366 /** 316 367 * @ticket 41683 317 368 */
Note: See TracChangeset
for help on using the changeset viewer.