Changeset 39556 for trunk/tests/phpunit/tests/option/siteOption.php
- Timestamp:
- 12/10/2016 12:01:30 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/option/siteOption.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/option/siteOption.php
r38382 r39556 14 14 15 15 function test_get_site_option_returns_false_after_deletion() { 16 $key = rand_str();17 $value = rand_str();16 $key = __FUNCTION__; 17 $value = __FUNCTION__; 18 18 add_site_option( $key, $value ); 19 19 delete_site_option( $key ); … … 22 22 23 23 function test_get_site_option_returns_value() { 24 $key = rand_str();25 $value = rand_str();24 $key = __FUNCTION__; 25 $value = __FUNCTION__; 26 26 add_site_option( $key, $value ); 27 27 $this->assertEquals( $value, get_site_option( $key ) ); … … 29 29 30 30 function test_get_site_option_returns_updated_value() { 31 $key = rand_str();32 $value = rand_str();33 $new_value = rand_str();31 $key = __FUNCTION__; 32 $value = __FUNCTION__ . '_1'; 33 $new_value = __FUNCTION__ . '_2'; 34 34 add_site_option( $key, $value ); 35 35 update_site_option( $key, $new_value ); … … 56 56 57 57 function test_get_site_option_exists_does_not_return_provided_default() { 58 $key = rand_str();59 $value = rand_str();58 $key = __FUNCTION__; 59 $value = __FUNCTION__; 60 60 add_site_option( $key, $value ); 61 61 $this->assertEquals( $value, get_site_option( $key, 'foo' ) ); … … 63 63 64 64 function test_get_site_option_exists_does_not_return_filtered_default() { 65 $key = rand_str();66 $value = rand_str();65 $key = __FUNCTION__; 66 $value = __FUNCTION__; 67 67 add_site_option( $key, $value ); 68 68 add_filter( 'default_site_option_' . $key , array( $this, '__return_foo' ) ); … … 73 73 74 74 function test_add_site_option_returns_true_for_new_option() { 75 $key = rand_str();76 $value = rand_str();75 $key = __FUNCTION__; 76 $value = __FUNCTION__; 77 77 $this->assertTrue( add_site_option( $key, $value ) ); 78 78 } 79 79 80 80 function test_add_site_option_returns_false_for_existing_option() { 81 $key = rand_str();82 $value = rand_str();81 $key = __FUNCTION__; 82 $value = __FUNCTION__; 83 83 add_site_option( $key, $value ); 84 84 $this->assertFalse( add_site_option( $key, $value ) ); … … 86 86 87 87 function test_update_site_option_returns_false_for_same_value() { 88 $key = rand_str();89 $value = rand_str();88 $key = __FUNCTION__; 89 $value = __FUNCTION__; 90 90 add_site_option( $key, $value ); 91 91 $this->assertFalse( update_site_option( $key, $value ) ); … … 101 101 102 102 function test_delete_site_option_returns_true_if_option_exists() { 103 $key = rand_str();104 $value = rand_str();103 $key = __FUNCTION__; 104 $value = __FUNCTION__; 105 105 add_site_option( $key, $value ); 106 106 $this->assertTrue( delete_site_option( $key ) ); … … 108 108 109 109 function test_delete_site_option_returns_false_if_option_does_not_exist() { 110 $key = rand_str();111 $value = rand_str();110 $key = __FUNCTION__; 111 $value = __FUNCTION__; 112 112 add_site_option( $key, $value ); 113 113 delete_site_option( $key ); … … 116 116 117 117 function test_site_option_add_and_get_serialized_array() { 118 $key = rand_str();118 $key = __FUNCTION__; 119 119 $value = array( 'foo' => true, 'bar' => true ); 120 120 add_site_option( $key, $value ); … … 123 123 124 124 function test_site_option_add_and_get_serialized_object() { 125 $key = rand_str();125 $key = __FUNCTION__; 126 126 $value = new stdClass(); 127 127 $value->foo = true; … … 133 133 // #15497 - ensure update_site_option will add options with false-y values 134 134 function test_update_adds_falsey_value() { 135 $key = rand_str();135 $key = __FUNCTION__; 136 136 $value = 0; 137 137 … … 144 144 // #18955 - ensure get_site_option doesn't cache the default value for non-existent options 145 145 function test_get_doesnt_cache_default_value() { 146 $option = rand_str();146 $option = __FUNCTION__; 147 147 $default = 'a default'; 148 148
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)