|
@@ 2585-2601 (lines=17) @@
|
| 2582 |
|
/** |
| 2583 |
|
* @ticket 37128 |
| 2584 |
|
*/ |
| 2585 |
|
function test_prepare_controls_wp_list_sort_sections() { |
| 2586 |
|
wp_set_current_user( self::$admin_user_id ); |
| 2587 |
|
|
| 2588 |
|
$sections = array( 'foo' => 2, 'bar' => 4, 'foobar' => 3, 'key' => 1 ); |
| 2589 |
|
$sections_sorted = array( 'key', 'foo', 'foobar', 'bar' ); |
| 2590 |
|
|
| 2591 |
|
foreach ( $sections as $section_id => $priority ) { |
| 2592 |
|
$this->manager->add_section( $section_id, array( |
| 2593 |
|
'priority' => $priority, |
| 2594 |
|
) ); |
| 2595 |
|
} |
| 2596 |
|
|
| 2597 |
|
$this->manager->prepare_controls(); |
| 2598 |
|
|
| 2599 |
|
$result = $this->manager->sections(); |
| 2600 |
|
$this->assertEquals( $sections_sorted, array_keys( $result ) ); |
| 2601 |
|
} |
| 2602 |
|
|
| 2603 |
|
/** |
| 2604 |
|
* @ticket 37128 |
|
@@ 2606-2622 (lines=17) @@
|
| 2603 |
|
/** |
| 2604 |
|
* @ticket 37128 |
| 2605 |
|
*/ |
| 2606 |
|
function test_prepare_controls_wp_list_sort_panels() { |
| 2607 |
|
wp_set_current_user( self::$admin_user_id ); |
| 2608 |
|
|
| 2609 |
|
$panels = array( 'foo' => 2, 'bar' => 4, 'foobar' => 3, 'key' => 1 ); |
| 2610 |
|
$panels_sorted = array( 'key', 'foo', 'foobar', 'bar' ); |
| 2611 |
|
|
| 2612 |
|
foreach ( $panels as $panel_id => $priority ) { |
| 2613 |
|
$this->manager->add_panel( $panel_id, array( |
| 2614 |
|
'priority' => $priority, |
| 2615 |
|
) ); |
| 2616 |
|
} |
| 2617 |
|
|
| 2618 |
|
$this->manager->prepare_controls(); |
| 2619 |
|
|
| 2620 |
|
$result = $this->manager->panels(); |
| 2621 |
|
$this->assertEquals( $panels_sorted, array_keys( $result ) ); |
| 2622 |
|
} |
| 2623 |
|
|
| 2624 |
|
/** |
| 2625 |
|
* Verify sanitization of external header video URL will trim the whitespaces in the beginning and end of the URL. |