Make WordPress Core

Changeset 39556


Ignore:
Timestamp:
12/10/2016 12:01:30 AM (10 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Remove some more randomness.

See #37371

Location:
trunk/tests/phpunit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase-rest-post-type-controller.php

    r38832 r39556  
    272272        protected function set_post_data( $args = array() ) {
    273273                $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',
    277277                        'name'    => 'test',
    278278                        'status'  => 'publish',
     
    287287                return wp_parse_args( $args, $this->set_post_data( array(
    288288                        'title'   => array(
    289                                 'raw' => rand_str(),
     289                                'raw' => 'Post Title',
    290290                        ),
    291291                        'content' => array(
    292                                 'raw' => rand_str(),
     292                                'raw' => 'Post content',
    293293                        ),
    294294                        'excerpt' => array(
    295                                 'raw' => rand_str(),
     295                                'raw' => 'Post excerpt',
    296296                        ),
    297297                ) ) );
  • trunk/tests/phpunit/tests/option/networkOption.php

    r37223 r39556  
    1818
    1919                $id = self::factory()->network->create();
    20                 $option = rand_str();
    21                 $value = rand_str();
     20                $option = __FUNCTION__;
     21                $value = __FUNCTION__;
    2222
    2323                add_site_option( $option, $value );
     
    3131
    3232                $id = self::factory()->network->create();
    33                 $option = rand_str();
    34                 $value = rand_str();
     33                $option = __FUNCTION__;
     34                $value = __FUNCTION__;
    3535
    3636                add_network_option( $id, $option, $value );
     
    4444
    4545                $id = self::factory()->network->create();
    46                 $option = rand_str();
    47                 $value = rand_str();
     46                $option = __FUNCTION__;
     47                $value = __FUNCTION__;
    4848
    4949                add_site_option( $option, $value );
     
    5757         */
    5858        public function test_add_network_option_is_not_stored_as_autoload_option() {
    59                 $key = rand_str();
     59                $key = __FUNCTION__;
    6060
    6161                if ( is_multisite() ) {
     
    7474         */
    7575        public function test_update_network_option_is_not_stored_as_autoload_option() {
    76                 $key = rand_str();
     76                $key = __FUNCTION__;
    7777
    7878                if ( is_multisite() ) {
  • trunk/tests/phpunit/tests/option/option.php

    r38382 r39556  
    7373
    7474        function test_serialized_data() {
    75                 $key = rand_str();
     75                $key = __FUNCTION__;
    7676                $value = array( 'foo' => true, 'bar' => true );
    7777
  • trunk/tests/phpunit/tests/option/siteOption.php

    r38382 r39556  
    1414
    1515        function test_get_site_option_returns_false_after_deletion() {
    16                 $key = rand_str();
    17                 $value = rand_str();
     16                $key = __FUNCTION__;
     17                $value = __FUNCTION__;
    1818                add_site_option( $key, $value );
    1919                delete_site_option( $key );
     
    2222
    2323        function test_get_site_option_returns_value() {
    24                 $key = rand_str();
    25                 $value = rand_str();
     24                $key = __FUNCTION__;
     25                $value = __FUNCTION__;
    2626                add_site_option( $key, $value );
    2727                $this->assertEquals( $value, get_site_option( $key ) );
     
    2929
    3030        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';
    3434                add_site_option( $key, $value );
    3535                update_site_option( $key, $new_value );
     
    5656
    5757        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__;
    6060                add_site_option( $key, $value );
    6161                $this->assertEquals( $value, get_site_option( $key, 'foo' ) );
     
    6363
    6464        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__;
    6767                add_site_option( $key, $value );
    6868                add_filter( 'default_site_option_' . $key , array( $this, '__return_foo' ) );
     
    7373
    7474        function test_add_site_option_returns_true_for_new_option() {
    75                 $key = rand_str();
    76                 $value = rand_str();
     75                $key = __FUNCTION__;
     76                $value = __FUNCTION__;
    7777                $this->assertTrue( add_site_option( $key, $value ) );
    7878        }
    7979
    8080        function test_add_site_option_returns_false_for_existing_option() {
    81                 $key = rand_str();
    82                 $value = rand_str();
     81                $key = __FUNCTION__;
     82                $value = __FUNCTION__;
    8383                add_site_option( $key, $value );
    8484                $this->assertFalse( add_site_option( $key, $value ) );
     
    8686
    8787        function test_update_site_option_returns_false_for_same_value() {
    88                 $key = rand_str();
    89                 $value = rand_str();
     88                $key = __FUNCTION__;
     89                $value = __FUNCTION__;
    9090                add_site_option( $key, $value );
    9191                $this->assertFalse( update_site_option( $key, $value ) );
     
    101101
    102102        function test_delete_site_option_returns_true_if_option_exists() {
    103                 $key = rand_str();
    104                 $value = rand_str();
     103                $key = __FUNCTION__;
     104                $value = __FUNCTION__;
    105105                add_site_option( $key, $value );
    106106                $this->assertTrue( delete_site_option( $key ) );
     
    108108
    109109        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__;
    112112                add_site_option( $key, $value );
    113113                delete_site_option( $key );
     
    116116
    117117        function test_site_option_add_and_get_serialized_array() {
    118                 $key = rand_str();
     118                $key = __FUNCTION__;
    119119                $value = array( 'foo' => true, 'bar' => true );
    120120                add_site_option( $key, $value );
     
    123123
    124124        function test_site_option_add_and_get_serialized_object() {
    125                 $key = rand_str();
     125                $key = __FUNCTION__;
    126126                $value = new stdClass();
    127127                $value->foo = true;
     
    133133        // #15497 - ensure update_site_option will add options with false-y values
    134134        function test_update_adds_falsey_value() {
    135                 $key = rand_str();
     135                $key = __FUNCTION__;
    136136                $value = 0;
    137137
     
    144144        // #18955 - ensure get_site_option doesn't cache the default value for non-existent options
    145145        function test_get_doesnt_cache_default_value() {
    146                 $option = rand_str();
     146                $option = __FUNCTION__;
    147147                $default = 'a default';
    148148
  • trunk/tests/phpunit/tests/option/siteTransient.php

    r38382 r39556  
    3131
    3232        function test_serialized_data() {
    33                 $key = rand_str();
     33                $key = __FUNCTION__;
    3434                $value = array( 'foo' => true, 'bar' => true );
    3535
     
    4747         */
    4848        public function test_set_site_transient_is_not_stored_as_autoload_option() {
    49                 $key = rand_str();
     49                $key = 'not_autoloaded';
    5050
    5151                if ( is_multisite() ) {
Note: See TracChangeset for help on using the changeset viewer.