WordPress.org

Make WordPress Core

Ticket #13923: 13923.unit-tests.diff

File 13923.unit-tests.diff, 1.4 KB (added by nacin, 4 years ago)

Unit tests

  • test_admin_includes_plugin.php

     
    3737            add_submenu_page('mt-top-level-handle', 'Test Sublevel', 'Test Sublevel', 'manage_options', 'sub-page', 'mt_sublevel_page'); 
    3838            add_submenu_page('mt-top-level-handle', 'Test Sublevel 2', 'Test Sublevel 2', 'manage_options', 'sub-page2', 'mt_sublevel_page2'); 
    3939            add_theme_page('With Spaces', 'With Spaces', 'manage_options', 'With Spaces', 'mt_tools_page'); 
     40            add_pages_page('Appending Query Arg', 'Test Pages', 'edit_pages', 'testpages', 'mt_pages_page' ); 
    4041             
    4142            //TODO: review the http://null.host/ here and work out if this is portable enough for testing on other hosts 
    4243            $expected['testsettings'] = 'http://null.host/wp-admin/options-general.php?page=testsettings'; 
     
    4647            $expected['sub-page2'] = 'http://null.host/wp-admin/mt-top-level-handle?page=sub-page2'; 
    4748            $expected['not_registered'] = ''; 
    4849            $expected['With Spaces'] = 'http://null.host/wp-admin/themes.php?page=WithSpaces'; 
    49              
     50            $expected['testpages'] = 'http://null.host/wp-admin/edit.php?post_type=page&page=testpages'; 
     51 
    5052                foreach ($expected as $name => $value) { 
    5153                        $this->assertEquals($value, menu_page_url($name, false) ); 
    5254                }