Changeset 38928 for trunk/tests/phpunit/tests/customize/manager.php
- Timestamp:
- 10/25/2016 09:25:25 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/manager.php
r38858 r38928 1863 1863 return $this->filtered_device_list(); 1864 1864 } 1865 1866 /** 1867 * @ticket 37128 1868 */ 1869 function test_prepare_controls_wp_list_sort_controls() { 1870 wp_set_current_user( self::$admin_user_id ); 1871 1872 $controls = array( 'foo' => 2, 'bar' => 4, 'foobar' => 3, 'key' => 1 ); 1873 $controls_sorted = array( 'key', 'foo', 'foobar', 'bar' ); 1874 1875 $this->manager->add_section( 'foosection', array() ); 1876 1877 foreach ( $controls as $control_id => $priority ) { 1878 $this->manager->add_setting( $control_id ); 1879 $this->manager->add_control( $control_id, array( 1880 'priority' => $priority, 1881 'section' => 'foosection', 1882 ) ); 1883 } 1884 1885 $this->manager->prepare_controls(); 1886 1887 $result = $this->manager->controls(); 1888 $this->assertEquals( $controls_sorted, array_keys( $result ) ); 1889 } 1890 1891 /** 1892 * @ticket 37128 1893 */ 1894 function test_prepare_controls_wp_list_sort_sections() { 1895 wp_set_current_user( self::$admin_user_id ); 1896 1897 $sections = array( 'foo' => 2, 'bar' => 4, 'foobar' => 3, 'key' => 1 ); 1898 $sections_sorted = array( 'key', 'foo', 'foobar', 'bar' ); 1899 1900 foreach ( $sections as $section_id => $priority ) { 1901 $this->manager->add_section( $section_id, array( 1902 'priority' => $priority, 1903 ) ); 1904 } 1905 1906 $this->manager->prepare_controls(); 1907 1908 $result = $this->manager->sections(); 1909 $this->assertEquals( $sections_sorted, array_keys( $result ) ); 1910 } 1911 1912 /** 1913 * @ticket 37128 1914 */ 1915 function test_prepare_controls_wp_list_sort_panels() { 1916 wp_set_current_user( self::$admin_user_id ); 1917 1918 $panels = array( 'foo' => 2, 'bar' => 4, 'foobar' => 3, 'key' => 1 ); 1919 $panels_sorted = array( 'key', 'foo', 'foobar', 'bar' ); 1920 1921 foreach ( $panels as $panel_id => $priority ) { 1922 $this->manager->add_panel( $panel_id, array( 1923 'priority' => $priority, 1924 ) ); 1925 } 1926 1927 $this->manager->prepare_controls(); 1928 1929 $result = $this->manager->panels(); 1930 $this->assertEquals( $panels_sorted, array_keys( $result ) ); 1931 } 1865 1932 } 1866 1933
Note: See TracChangeset
for help on using the changeset viewer.