Index: tests/phpunit/tests/admin/includesMisc.php
===================================================================
--- tests/phpunit/tests/admin/includesMisc.php	(revision 39474)
+++ tests/phpunit/tests/admin/includesMisc.php	(working copy)
@@ -7,19 +7,92 @@
 	function test_shorten_url() {
 		$tests = array(
 			'wordpress\.org/about/philosophy'
-				=> 'wordpress\.org/about/philosophy', // no longer strips slashes
+			=> 'wordpress\.org/about/philosophy', // no longer strips slashes
 			'wordpress.org/about/philosophy'
-				=> 'wordpress.org/about/philosophy',
+			=> 'wordpress.org/about/philosophy',
 			'http://wordpress.org/about/philosophy/'
-				=> 'wordpress.org/about/philosophy', // remove http, trailing slash
+			=> 'wordpress.org/about/philosophy', // remove http, trailing slash
 			'http://www.wordpress.org/about/philosophy/'
-				=> 'wordpress.org/about/philosophy', // remove http, www
+			=> 'wordpress.org/about/philosophy', // remove http, www
 			'http://wordpress.org/about/philosophy/#box'
-				=> 'wordpress.org/about/philosophy/#box', // don't shorten 35 characters
+			=> 'wordpress.org/about/philosophy/#box', // don't shorten 35 characters
 			'http://wordpress.org/about/philosophy/#decisions'
-				=> 'wordpress.org/about/philosophy/#&hellip;', // shorten to 32 if > 35 after cleaning
+			=> 'wordpress.org/about/philosophy/#&hellip;', // shorten to 32 if > 35 after cleaning
 		);
-		foreach ( $tests as $k => $v )
+		foreach ( $tests as $k => $v ) {
 			$this->assertEquals( $v, url_shorten( $k ) );
+		}
 	}
+
+	public function test_get_current_admin_page_url_returns_false_in_non_admin() {
+		set_current_screen( 'front' );
+
+		$this->assertFalse( is_admin() );
+
+		$this->assertFalse( get_current_admin_page_url() );
+	}
+
+	public function test_get_current_admin_page_url_returns_empty_string_for_empty_pagenow_or_SERVER_values() {
+		global $pagenow;
+		$pagenow                 = '';
+		$_SERVER['QUERY_STRING'] = '';
+
+		// any admin screen will do for the purpose of testing
+		set_current_screen( 'edit.php' );
+
+		$this->assertTrue( is_admin() );
+
+		$this->assertEquals( '', get_current_admin_page_url() );
+	}
+
+	public function pagenow_and_SERVER_QUERY_STRING() {
+		return array(
+			array( 'some-admin-page.php', 'some-admin-page.php', '' ),
+			array( 'some-admin-page.php?foo=bar', 'some-admin-page.php', 'foo=bar' ),
+			array( 'some-admin-page.php?foo=bar&baz=bar', 'some-admin-page.php', 'foo=bar&baz=bar' ),
+		);
+	}
+
+	/**
+	 * @dataProvider pagenow_and_SERVER_QUERY_STRING
+	 */
+	public function test_get_current_admin_page_url( $expected, $mock_pagenow, $server_query_string ) {
+		global $pagenow;
+		$pagenow                 = $mock_pagenow;
+		$_SERVER['QUERY_STRING'] = $server_query_string;
+
+		// any admin screen will do for the purpose of testing
+		set_current_screen( 'edit.php' );
+
+		$this->assertTrue( is_admin() );
+
+		$this->assertEquals( $expected, get_current_admin_page_url() );
+	}
+
+	public function test_get_current_admin_hook_will_return_false_in_not_admin() {
+		set_current_screen( 'front' );
+
+		$this->assertFalse( get_current_admin_hook() );
+	}
+
+	public function current_filters() {
+		return array(
+			array( '', array( '' ) ),
+			array( 'some_hook', array( 'some_hook' ) ),
+			array( 'another_hook', array( 'some_hook', 'another_hook' ) ),
+		);
+	}
+
+	/**
+	 * @dataProvider current_filters
+	 */
+	public function test_get_current_admin_hook( $expected, $mock_current_filter ) {
+		// any admin screen will do for the purpose of testing
+		set_current_screen( 'edit.php' );
+
+		global $wp_current_filter;
+		$wp_current_filter = $mock_current_filter;
+
+		$this->assertEquals( $expected, get_current_admin_hook() );
+	}
 }
