Changeset 39556
- Timestamp:
- 12/10/2016 12:01:30 AM (8 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase-rest-post-type-controller.php
r38832 r39556 272 272 protected function set_post_data( $args = array() ) { 273 273 $defaults = array( 274 'title' => rand_str(),275 'content' => rand_str(),276 'excerpt' => rand_str(),274 'title' => 'Post Title', 275 'content' => 'Post content', 276 'excerpt' => 'Post excerpt', 277 277 'name' => 'test', 278 278 'status' => 'publish', … … 287 287 return wp_parse_args( $args, $this->set_post_data( array( 288 288 'title' => array( 289 'raw' => rand_str(),289 'raw' => 'Post Title', 290 290 ), 291 291 'content' => array( 292 'raw' => rand_str(),292 'raw' => 'Post content', 293 293 ), 294 294 'excerpt' => array( 295 'raw' => rand_str(),295 'raw' => 'Post excerpt', 296 296 ), 297 297 ) ) ); -
trunk/tests/phpunit/tests/option/networkOption.php
r37223 r39556 18 18 19 19 $id = self::factory()->network->create(); 20 $option = rand_str();21 $value = rand_str();20 $option = __FUNCTION__; 21 $value = __FUNCTION__; 22 22 23 23 add_site_option( $option, $value ); … … 31 31 32 32 $id = self::factory()->network->create(); 33 $option = rand_str();34 $value = rand_str();33 $option = __FUNCTION__; 34 $value = __FUNCTION__; 35 35 36 36 add_network_option( $id, $option, $value ); … … 44 44 45 45 $id = self::factory()->network->create(); 46 $option = rand_str();47 $value = rand_str();46 $option = __FUNCTION__; 47 $value = __FUNCTION__; 48 48 49 49 add_site_option( $option, $value ); … … 57 57 */ 58 58 public function test_add_network_option_is_not_stored_as_autoload_option() { 59 $key = rand_str();59 $key = __FUNCTION__; 60 60 61 61 if ( is_multisite() ) { … … 74 74 */ 75 75 public function test_update_network_option_is_not_stored_as_autoload_option() { 76 $key = rand_str();76 $key = __FUNCTION__; 77 77 78 78 if ( is_multisite() ) { -
trunk/tests/phpunit/tests/option/option.php
r38382 r39556 73 73 74 74 function test_serialized_data() { 75 $key = rand_str();75 $key = __FUNCTION__; 76 76 $value = array( 'foo' => true, 'bar' => true ); 77 77 -
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 -
trunk/tests/phpunit/tests/option/siteTransient.php
r38382 r39556 31 31 32 32 function test_serialized_data() { 33 $key = rand_str();33 $key = __FUNCTION__; 34 34 $value = array( 'foo' => true, 'bar' => true ); 35 35 … … 47 47 */ 48 48 public function test_set_site_transient_is_not_stored_as_autoload_option() { 49 $key = rand_str();49 $key = 'not_autoloaded'; 50 50 51 51 if ( is_multisite() ) {
Note: See TracChangeset
for help on using the changeset viewer.