Changeset 48121 for trunk/tests/phpunit/tests/multisite/siteDetails.php
- Timestamp:
- 06/22/2020 05:24:34 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/siteDetails.php
r47122 r48121 10 10 class Tests_Multisite_Site_Details extends WP_UnitTestCase { 11 11 /** 12 * @dataProvider data_ whitelisted_options12 * @dataProvider data_allowed_options 13 13 * 14 14 * @ticket 40063 15 15 */ 16 public function test_update_ whitelisted_option_deletes_site_details_cache( $whitelisted_option, $temporary_value ) {16 public function test_update_allowed_option_deletes_site_details_cache( $allowed_option, $temporary_value ) { 17 17 $site = get_site(); 18 18 19 $original_value = $site->$ whitelisted_option;20 update_option( $ whitelisted_option, $temporary_value );19 $original_value = $site->$allowed_option; 20 update_option( $allowed_option, $temporary_value ); 21 21 22 22 $cached_result = wp_cache_get( $site->id, 'site-details' ); 23 23 24 24 /* Reset to original value. */ 25 update_option( $ whitelisted_option, $original_value );25 update_option( $allowed_option, $original_value ); 26 26 27 27 $this->assertFalse( $cached_result ); … … 29 29 30 30 /** 31 * @dataProvider data_ whitelisted_options31 * @dataProvider data_allowed_options 32 32 * 33 33 * @ticket 40063 34 34 */ 35 public function test_update_ whitelisted_option_deletes_blog_details_cache( $whitelisted_option, $temporary_value ) {35 public function test_update_allowed_option_deletes_blog_details_cache( $allowed_option, $temporary_value ) { 36 36 $blog_details = get_blog_details(); 37 37 38 $original_value = $blog_details->$ whitelisted_option;39 update_option( $ whitelisted_option, $temporary_value );38 $original_value = $blog_details->$allowed_option; 39 update_option( $allowed_option, $temporary_value ); 40 40 41 41 $cached_result = wp_cache_get( $blog_details->id, 'blog-details' ); 42 42 43 43 /* Reset to original value. */ 44 update_option( $ whitelisted_option, $original_value );44 update_option( $allowed_option, $original_value ); 45 45 46 46 $this->assertFalse( $cached_result ); … … 48 48 49 49 /** 50 * @dataProvider data_ whitelisted_options50 * @dataProvider data_allowed_options 51 51 * 52 52 * @ticket 40063 53 53 */ 54 public function test_update_ whitelisted_option_does_not_delete_site_cache( $whitelisted_option, $temporary_value ) {54 public function test_update_allowed_option_does_not_delete_site_cache( $allowed_option, $temporary_value ) { 55 55 $site = get_site(); 56 56 57 $original_value = $site->$ whitelisted_option;58 update_option( $ whitelisted_option, $temporary_value );57 $original_value = $site->$allowed_option; 58 update_option( $allowed_option, $temporary_value ); 59 59 60 60 $cached_result = wp_cache_get( $site->id, 'sites' ); 61 61 62 62 /* Reset to original value. */ 63 update_option( $ whitelisted_option, $original_value );63 update_option( $allowed_option, $original_value ); 64 64 65 65 $this->assertNotFalse( $cached_result ); … … 67 67 68 68 /** 69 * @dataProvider data_ whitelisted_options69 * @dataProvider data_allowed_options 70 70 * 71 71 * @ticket 40063 72 72 */ 73 public function test_update_ whitelisted_option_does_not_delete_short_blog_details_cache( $whitelisted_option, $temporary_value ) {73 public function test_update_allowed_option_does_not_delete_short_blog_details_cache( $allowed_option, $temporary_value ) { 74 74 $blog_details = get_blog_details( null, false ); 75 75 76 $original_value = get_option( $ whitelisted_option );77 update_option( $ whitelisted_option, $temporary_value );76 $original_value = get_option( $allowed_option ); 77 update_option( $allowed_option, $temporary_value ); 78 78 79 79 $cached_result = wp_cache_get( $blog_details->id . 'short', 'blog-details' ); 80 80 81 81 /* Reset to original value. */ 82 update_option( $ whitelisted_option, $original_value );82 update_option( $allowed_option, $original_value ); 83 83 84 84 $this->assertNotFalse( $cached_result ); … … 86 86 87 87 /** 88 * @dataProvider data_ whitelisted_options88 * @dataProvider data_allowed_options 89 89 * 90 90 * @ticket 40063 91 91 */ 92 public function test_update_ whitelisted_option_does_not_update_sites_last_changed( $whitelisted_option, $temporary_value ) {92 public function test_update_allowed_option_does_not_update_sites_last_changed( $allowed_option, $temporary_value ) { 93 93 $last_changed = wp_cache_get_last_changed( 'sites' ); 94 94 95 $original_value = get_option( $ whitelisted_option );96 update_option( $ whitelisted_option, $temporary_value );95 $original_value = get_option( $allowed_option ); 96 update_option( $allowed_option, $temporary_value ); 97 97 98 98 $new_last_changed = wp_cache_get_last_changed( 'sites' ); 99 99 100 100 /* Reset to original value. */ 101 update_option( $ whitelisted_option, $original_value );101 update_option( $allowed_option, $original_value ); 102 102 103 103 $this->assertSame( $new_last_changed, $last_changed ); 104 104 } 105 105 106 public function data_ whitelisted_options() {106 public function data_allowed_options() { 107 107 return array( 108 108 array( 'blogname', 'Custom Site' ),
Note: See TracChangeset
for help on using the changeset viewer.