Changeset 904 in tests for trunk/tests/admin/includesPlugin.php
- Timestamp:
- 07/18/2012 07:01:41 PM (12 years ago)
- Location:
- trunk/tests/admin
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/admin/includesPlugin.php
r903 r904 4 4 * @group admin 5 5 */ 6 class Test PluginDataextends WP_UnitTestCase {6 class Tests_Admin_includesPlugin extends WP_UnitTestCase { 7 7 function test_get_plugin_data() { 8 8 $data = get_plugin_data( DIR_TESTDATA . '/plugins/hello.php' ); … … 27 27 } 28 28 } 29 }30 31 /**32 * @group plugins33 * @group admin34 */35 class TestPluginMenus extends WP_UnitTestCase {36 37 protected $current_user;38 39 function setUp() {40 parent::setUp();41 $this->current_user = get_current_user_id();42 // pages require manage_options, ensure we're an administrator43 $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );44 wp_set_current_user( $user_id );45 update_option( 'siteurl', 'http://example.com' );46 }47 48 function tearDown() {49 parent::tearDown();50 wp_set_current_user( $this->current_user );51 }52 29 53 30 function test_menu_page_url() { 31 $current_user = get_current_user_id(); 32 wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) ); 33 update_option( 'siteurl', 'http://example.com' ); 34 54 35 // add some pages 55 36 add_options_page( 'Test Settings', 'Test Settings', 'manage_options', 'testsettings', 'mt_settings_page' ); … … 73 54 $this->assertEquals( $value, menu_page_url( $name, false ) ); 74 55 } 56 57 wp_set_current_user( $current_user ); 75 58 } 76 59 }
Note: See TracChangeset
for help on using the changeset viewer.