Changeset 1060 in tests
- Timestamp:
- 10/01/2012 06:03:48 PM (13 years ago)
- Location:
- trunk/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/cache.php
r946 r1060 21 21 function &init_cache() { 22 22 $cache = new WP_Object_Cache(); 23 $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' ) );23 $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' ) ); 24 24 return $cache; 25 25 } -
trunk/tests/ms.php
r1055 r1060 27 27 $this->assertEquals( $blog_id, get_id_from_blogname( $details->path ) ); 28 28 $this->assertEquals( $blog_id, wp_cache_get( 'get_id_from_blogname_' . trim( $details->path, '/' ), 'blog-details' ) ); 29 30 // get_blog_id_from_url() 31 $this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) ); 32 $key = md5( $details->domain . $details->path ); 33 $this->assertEquals( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) ); 29 34 30 35 // These are empty until get_blog_details() is called with $get_all = true … … 69 74 $key = md5( $details->domain . $details->path ); 70 75 $this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) ); 76 $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) ); 71 77 72 78 $prefix = $wpdb->get_blog_prefix( $blog_id ); … … 531 537 $this->assertEquals( null, domain_exists( $details->domain, $details->path ) ); 532 538 } 539 540 function test_get_blog_id_from_url() { 541 $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); 542 $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/testdomainexists', 'title' => 'Test Title' ) ); 543 544 $details = get_blog_details( $blog_id, false ); 545 546 $this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) ); 547 $key = md5( $details->domain . $details->path ); 548 $this->assertEquals( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) ); 549 550 $this->assertEquals( 0, get_blog_id_from_url( $details->domain, 'foo' ) ); 551 552 wpmu_delete_blog( $blog_id ); 553 $this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) ); 554 wpmu_delete_blog( $blog_id, true ); 555 556 $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) ); 557 $this->assertEquals( 0, get_blog_id_from_url( $details->domain, $details->path ) ); 558 } 533 559 } 534 560
Note: See TracChangeset
for help on using the changeset viewer.