Index: wp-testcase/test_screen.php
===================================================================
--- wp-testcase/test_screen.php	(revision 0)
+++ wp-testcase/test_screen.php	(revision 0)
@@ -0,0 +1,81 @@
+<?php
+
+class WPTestScreen extends WPTestCase {
+	var $core_screens = array(
+								'index.php' => array( 'base' => 'dashboard', 'id' => 'dashboard' ),
+								'edit.php' => array( 'base' => 'edit', 'id' => 'edit-post', 'post_type' => 'post' ),
+								'post-new.php'=> array( 'action' => 'add', 'base' => 'post', 'id' => 'post', 'post_type' => 'post' ),
+								'edit-tags.php?taxonomy=category' => array( 'base' => 'edit-tags', 'id' => 'edit-category', 'post_type' => 'post', 'taxonomy' => 'category' ),
+								'edit-tags.php?taxonomy=post_tag' => array( 'base' => 'edit-tags', 'id' => 'edit-post_tag', 'post_type' => 'post', 'taxonomy' => 'post_tag' ),
+								'upload.php' => array( 'base' => 'upload', 'id' => 'upload' ),
+								'media-new.php' => array( 'action' => 'add', 'base' => 'media', 'id' => 'media' ),
+								'edit.php?post_type=page' => array( 'base' => 'edit', 'id' => 'edit-page', 'post_type' => 'page' ),
+								'link-manager.php' => array( 'base' => 'link-manager', 'id' => 'link-manager' ),
+								'link-add.php' => array( 'action' => 'add', 'base' => 'link', 'id' => 'link' ),
+								'edit-comments.php' => array( 'base' => 'edit-comments', 'id' => 'edit-comments' ),
+								'themes.php' => array( 'base' => 'themes', 'id' => 'themes' ),
+								'widgets.php' => array( 'base' => 'widgets', 'id' => 'widgets' ),
+								'nav-menus.php' => array( 'base' => 'nav-menus', 'id' => 'nav-menus' ),
+								'plugins.php' => array( 'base' => 'plugins', 'id' => 'plugins' ),
+								'users.php' => array( 'base' => 'users', 'id' => 'users' ),
+								'user-new.php' => array( 'action' => 'add', 'base' => 'user', 'id' => 'user' ),
+								'profile.php' => array( 'base' => 'profile', 'id' => 'profile' ),
+								'tools.php' => array( 'base' => 'tools', 'id' => 'tools' ),
+								'import.php' => array( 'base' => 'import', 'id' => 'import' ),
+								'export.php' => array( 'base' => 'export', 'id' => 'export' ),
+								'options-general.php' => array( 'base' => 'options-general', 'id' => 'options-general' ),
+								'options-writing.php' => array( 'base' => 'options-writing', 'id' => 'options-writing' )
+							);
+
+	var $old_GET;
+	var $old_POST;
+	var $old_REQUEST;
+
+	function setUp() {
+		parent::setUp();
+
+		$this->old_GET = $_GET;
+		$this->old_POST = $_POST;
+		$this->old_REQUEST = $_REQUEST;
+	}
+
+	function tearDown() {
+		parent::tearDown();
+
+		$_GET = $this->old_GET;
+		$_POST = $this->old_POST;
+		$_REQUEST = $this->old_REQUEST;
+	}
+
+	function test_set_current_screen_with_hook_suffix() {
+		global $current_screen;
+
+		foreach ( $this->core_screens as $hook_name => $screen ) {
+			$_GET = array();
+			$GLOBALS[ 'taxnow' ] = $GLOBALS[ 'typenow' ] = '';
+			$screen = (object) $screen;
+			$hook = parse_url( $hook_name );
+			if ( $hook[ 'query' ] ) {
+				$args = wp_parse_args( $hook[ 'query' ] );
+				debug_log( $args );
+				if ( isset( $args[ 'taxonomy' ] ) )
+					$GLOBALS[ 'taxnow' ] = $_GET[ 'taxonomy' ] = $_POST[ 'taxonomy' ] = $_REQUEST['taxonomy'] = $args[ 'taxonomy' ];
+				if ( isset( $args[ 'post_type' ] ) )
+					$GLOBALS[ 'typenow' ] = $_GET[ 'post_type' ] = $_POST[ 'post_type' ] = $_REQUEST[ 'post_type' ] = $args[ 'post_type' ];
+				else if ( isset( $screen->post_type ) )
+					$GLOBALS[ 'typenow' ] = $_GET[ 'post_type' ] = $_POST[ 'post_type' ] = $_REQUEST[ 'post_type' ] = $screen->post_type;
+			}
+			debug_log( $hook );
+			$GLOBALS[ 'hook_suffix' ] = $hook['path'];
+			set_current_screen();
+			$this->assertEquals( $screen->id, $current_screen->id );
+			$this->assertEquals( $screen->base, $current_screen->base );
+			if ( isset( $screen->action ) )
+				$this->assertEquals( $screen->action, $current_screen->action, $hook_name );
+			if ( isset( $screen->post_type ) && ! isset( $screen->taxonomy) )  // Remove !isset once 18785.6.diff is applied
+				$this->assertEquals( $screen->post_type, $current_screen->post_type, $hook_name );
+			if ( isset( $screen->taxonomy ) )
+				$this->assertEquals( $screen->taxonomy, $current_screen->taxonomy, $hook_name );
+		}
+	}
+}
\ No newline at end of file
