Changeset 999 in tests for trunk/tests/admin/includesScreen.php
- Timestamp:
- 08/31/2012 05:17:58 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/admin/includesScreen.php
r909 r999 71 71 $this->assertEquals( $screen->taxonomy, $current_screen->taxonomy, $hook_name ); 72 72 73 $this->assertTrue( $current_screen->in_admin() ); 74 $this->assertTrue( $current_screen->in_admin( 'site' ) ); 75 $this->assertFalse( $current_screen->in_admin( 'network' ) ); 76 $this->assertFalse( $current_screen->in_admin( 'user' ) ); 77 $this->assertFalse( $current_screen->in_admin( 'garbage' ) ); 78 73 79 // With convert_to_screen(), the same ID should return the exact $current_screen. 74 80 $this->assertSame( $current_screen, convert_to_screen( $screen->id ), $hook_name ); … … 164 170 $this->assertEquals( $screen->get_help_tabs(), array() ); 165 171 } 172 173 function test_in_admin() { 174 $screen = get_current_screen(); 175 176 set_current_screen( 'edit.php' ); 177 $this->assertTrue( get_current_screen()->in_admin() ); 178 $this->assertTrue( get_current_screen()->in_admin( 'site' ) ); 179 $this->assertFalse( get_current_screen()->in_admin( 'network' ) ); 180 $this->assertFalse( get_current_screen()->in_admin( 'user' ) ); 181 182 set_current_screen( 'dashboard-network' ); 183 $this->assertTrue( get_current_screen()->in_admin() ); 184 $this->assertFalse( get_current_screen()->in_admin( 'site' ) ); 185 $this->assertTrue( get_current_screen()->in_admin( 'network' ) ); 186 $this->assertFalse( get_current_screen()->in_admin( 'user' ) ); 187 188 set_current_screen( 'dashboard-user' ); 189 $this->assertTrue( get_current_screen()->in_admin() ); 190 $this->assertFalse( get_current_screen()->in_admin( 'site' ) ); 191 $this->assertFalse( get_current_screen()->in_admin( 'network' ) ); 192 $this->assertTrue( get_current_screen()->in_admin( 'user' ) ); 193 194 set_current_screen( 'front' ); 195 $this->assertFalse( get_current_screen()->in_admin() ); 196 $this->assertFalse( get_current_screen()->in_admin( 'site' ) ); 197 $this->assertFalse( get_current_screen()->in_admin( 'network' ) ); 198 $this->assertFalse( get_current_screen()->in_admin( 'user' ) ); 199 200 $GLOBALS['current_screen'] = $screen; 201 } 166 202 }
Note: See TracChangeset
for help on using the changeset viewer.