|
@@ 2731-2747 (lines=17) @@
|
| 2728 |
|
/** |
| 2729 |
|
* @ticket 37128 |
| 2730 |
|
*/ |
| 2731 |
|
function test_prepare_controls_wp_list_sort_sections() |
| 2732 |
|
{ |
| 2733 |
|
wp_set_current_user(self::$admin_user_id); |
| 2734 |
|
|
| 2735 |
|
$sections = array( 'foo' => 2, 'bar' => 4, 'foobar' => 3, 'key' => 1 ); |
| 2736 |
|
$sections_sorted = array( 'key', 'foo', 'foobar', 'bar' ); |
| 2737 |
|
|
| 2738 |
|
foreach ( $sections as $section_id => $priority ) { |
| 2739 |
|
$this->manager->add_section( |
| 2740 |
|
$section_id, array( |
| 2741 |
|
'priority' => $priority, |
| 2742 |
|
) |
| 2743 |
|
); |
| 2744 |
|
} |
| 2745 |
|
|
| 2746 |
|
$this->manager->prepare_controls(); |
| 2747 |
|
|
| 2748 |
|
$result = $this->manager->sections(); |
| 2749 |
|
$this->assertEquals($sections_sorted, array_keys($result)); |
| 2750 |
|
} |
|
@@ 2755-2771 (lines=17) @@
|
| 2752 |
|
/** |
| 2753 |
|
* @ticket 37128 |
| 2754 |
|
*/ |
| 2755 |
|
function test_prepare_controls_wp_list_sort_panels() |
| 2756 |
|
{ |
| 2757 |
|
wp_set_current_user(self::$admin_user_id); |
| 2758 |
|
|
| 2759 |
|
$panels = array( 'foo' => 2, 'bar' => 4, 'foobar' => 3, 'key' => 1 ); |
| 2760 |
|
$panels_sorted = array( 'key', 'foo', 'foobar', 'bar' ); |
| 2761 |
|
|
| 2762 |
|
foreach ( $panels as $panel_id => $priority ) { |
| 2763 |
|
$this->manager->add_panel( |
| 2764 |
|
$panel_id, array( |
| 2765 |
|
'priority' => $priority, |
| 2766 |
|
) |
| 2767 |
|
); |
| 2768 |
|
} |
| 2769 |
|
|
| 2770 |
|
$this->manager->prepare_controls(); |
| 2771 |
|
|
| 2772 |
|
$result = $this->manager->panels(); |
| 2773 |
|
$this->assertEquals($panels_sorted, array_keys($result)); |
| 2774 |
|
} |