Make WordPress Core


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

Build/Test Tools: Remove some more randomness.

See #37371

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.