Changeset 53865 for trunk/tests/phpunit/tests/option/siteOption.php
- Timestamp:
- 08/08/2022 11:33:11 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/option/siteOption.php
r52010 r53865 9 9 } 10 10 11 /** 12 * @covers ::get_site_option 13 */ 11 14 public function test_get_site_option_returns_false_if_option_does_not_exist() { 12 15 $this->assertFalse( get_site_option( 'doesnotexist' ) ); 13 16 } 14 17 18 /** 19 * @covers ::add_site_option 20 * @covers ::delete_site_option 21 * @covers ::get_site_option 22 */ 15 23 public function test_get_site_option_returns_false_after_deletion() { 16 24 $key = __FUNCTION__; … … 21 29 } 22 30 31 /** 32 * @covers ::add_site_option 33 * @covers ::get_site_option 34 */ 23 35 public function test_get_site_option_returns_value() { 24 36 $key = __FUNCTION__; … … 28 40 } 29 41 42 /** 43 * @covers ::add_site_option 44 * @covers ::update_site_option 45 * @covers ::get_site_option 46 */ 30 47 public function test_get_site_option_returns_updated_value() { 31 48 $key = __FUNCTION__; … … 37 54 } 38 55 56 /** 57 * @covers ::add_filter 58 * @covers ::get_site_option 59 * @covers ::remove_filter 60 */ 39 61 public function test_get_site_option_does_not_exist_returns_filtered_default_with_no_default_provided() { 40 62 add_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) ); … … 44 66 } 45 67 68 /** 69 * @covers ::add_filter 70 * @covers ::get_site_option 71 * @covers ::remove_filter 72 */ 46 73 public function test_get_site_option_does_not_exist_returns_filtered_default_with_default_provided() { 47 74 add_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) ); … … 51 78 } 52 79 80 /** 81 * @covers ::get_site_option 82 */ 53 83 public function test_get_site_option_does_not_exist_returns_provided_default() { 54 84 $this->assertSame( 'bar', get_site_option( 'doesnotexist', 'bar' ) ); 55 85 } 56 86 87 /** 88 * @covers ::add_site_option 89 * @covers ::get_site_option 90 */ 57 91 public function test_get_site_option_exists_does_not_return_provided_default() { 58 92 $key = __FUNCTION__; … … 62 96 } 63 97 98 /** 99 * @covers ::add_site_option 100 * @covers ::add_filter 101 * @covers ::get_site_option 102 * @covers ::remove_filter 103 */ 64 104 public function test_get_site_option_exists_does_not_return_filtered_default() { 65 105 $key = __FUNCTION__; … … 72 112 } 73 113 114 /** 115 * @covers ::add_site_option 116 */ 74 117 public function test_add_site_option_returns_true_for_new_option() { 75 118 $key = __FUNCTION__; … … 78 121 } 79 122 123 /** 124 * @covers ::add_site_option 125 */ 80 126 public function test_add_site_option_returns_false_for_existing_option() { 81 127 $key = __FUNCTION__; … … 85 131 } 86 132 133 /** 134 * @covers ::add_site_option 135 * @covers ::update_site_option 136 */ 87 137 public function test_update_site_option_returns_false_for_same_value() { 88 138 $key = __FUNCTION__; … … 92 142 } 93 143 144 /** 145 * @covers ::add_site_option 146 * @covers ::update_site_option 147 */ 94 148 public function test_update_site_option_returns_true_for_new_value() { 95 149 $key = 'key'; … … 100 154 } 101 155 156 /** 157 * @covers ::add_site_option 158 * @covers ::delete_site_option 159 */ 102 160 public function test_delete_site_option_returns_true_if_option_exists() { 103 161 $key = __FUNCTION__; … … 107 165 } 108 166 167 /** 168 * @covers ::add_site_option 169 * @covers ::delete_site_option 170 */ 109 171 public function test_delete_site_option_returns_false_if_option_does_not_exist() { 110 172 $key = __FUNCTION__; … … 115 177 } 116 178 179 /** 180 * @covers ::add_site_option 181 * @covers ::get_site_option 182 */ 117 183 public function test_site_option_add_and_get_serialized_array() { 118 184 $key = __FUNCTION__; … … 125 191 } 126 192 193 /** 194 * @covers ::add_site_option 195 * @covers ::get_site_option 196 */ 127 197 public function test_site_option_add_and_get_serialized_object() { 128 198 $key = __FUNCTION__; … … 138 208 * 139 209 * @ticket 15497 210 * 211 * @covers ::update_site_option 212 * @covers ::get_site_option 140 213 */ 141 214 public function test_update_adds_falsey_value() { … … 153 226 * 154 227 * @ticket 18955 228 * 229 * @covers ::get_site_option 155 230 */ 156 231 public function test_get_doesnt_cache_default_value() {
Note: See TracChangeset
for help on using the changeset viewer.