Index: tests/cache.php
===================================================================
--- tests/cache.php	(revision 1058)
+++ tests/cache.php	(working copy)
@@ -20,7 +20,7 @@
 
 	function &init_cache() {
 		$cache = new WP_Object_Cache();
-		$cache->add_global_groups( array( 'global-cache-test', 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) );
+		$cache->add_global_groups( array( 'global-cache-test', 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache' ) );
 		return $cache;
 	}
 
Index: tests/ms.php
===================================================================
--- tests/ms.php	(revision 1058)
+++ tests/ms.php	(working copy)
@@ -27,6 +27,11 @@
 			$this->assertEquals( $blog_id, get_id_from_blogname( $details->path ) );
 			$this->assertEquals( $blog_id, wp_cache_get( 'get_id_from_blogname_' . trim( $details->path, '/' ), 'blog-details' ) );
 
+			// get_blog_id_from_url()
+			$this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
+			$key = md5( $details->domain . $details->path );
+			$this->assertEquals( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
+
 			// These are empty until get_blog_details() is called with $get_all = true
 			$this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
 			$key = md5( $details->domain . $details->path );
@@ -68,6 +73,7 @@
 			$this->assertEquals( false, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
 			$key = md5( $details->domain . $details->path );
 			$this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
+			$this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
 
 			$prefix = $wpdb->get_blog_prefix( $blog_id );
 			foreach ( $wpdb->tables( 'blog', false ) as $table ) {
@@ -530,6 +536,26 @@
 		wpmu_delete_blog( $blog_id, true );
 		$this->assertEquals( null, domain_exists( $details->domain, $details->path ) );
 	}
+
+	function test_get_blog_id_from_url() {
+		$user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+		$blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/testdomainexists', 'title' => 'Test Title' ) );
+	
+		$details = get_blog_details( $blog_id, false );
+
+		$this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
+		$key = md5( $details->domain . $details->path );
+		$this->assertEquals( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
+
+		$this->assertEquals( 0, get_blog_id_from_url( $details->domain, 'foo' ) );
+
+		wpmu_delete_blog( $blog_id );
+		$this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
+		wpmu_delete_blog( $blog_id, true );
+
+		$this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
+		$this->assertEquals( 0, get_blog_id_from_url( $details->domain, $details->path ) );
+	}
 }
 
 endif;
