Make WordPress Core

Changeset 34766


Ignore:
Timestamp:
10/02/2015 05:08:13 AM (11 years ago)
Author:
wonderboymusic
Message:

Unit Tests: tests that want to flush the cache should use their instance method instead of calling wp_cache_flush() - more properties need to be wiped out in between tests.

Props ocean90.
See #31491.

Location:
trunk/tests/phpunit/tests/option
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/option/siteOption.php

    r34759 r34766  
    138138                delete_site_option( $key );
    139139                $this->assertTrue( update_site_option( $key, $value ) );
    140                 wp_cache_flush(); // ensure we're getting the value from the DB
     140                $this->flush_cache(); // ensure we're getting the value from the DB
    141141                $this->assertEquals( $value, get_site_option( $key ) );
    142142        }
  • trunk/tests/phpunit/tests/option/updateOption.php

    r33703 r34766  
    2626
    2727                global $wpdb;
    28                 wp_cache_flush();
     28                $this->flush_cache();
    2929                update_option( 'test_update_option_default', 'value' );
    30                 wp_cache_flush();
     30                $this->flush_cache();
    3131
    3232                // Populate the alloptions cache, which includes autoload=yes options.
    … …  
    5050
    5151                global $wpdb;
    52                 wp_cache_flush();
     52                $this->flush_cache();
    5353                update_option( 'test_update_option_default', 'value', 'yes' );
    54                 wp_cache_flush();
     54                $this->flush_cache();
    5555
    5656                // Populate the alloptions cache, which includes autoload=yes options.
    … …  
    7474
    7575                global $wpdb;
    76                 wp_cache_flush();
     76                $this->flush_cache();
    7777                update_option( 'test_update_option_default', 'value', 'no' );
    78                 wp_cache_flush();
     78                $this->flush_cache();
    7979
    8080                // Populate the alloptions cache, which does not include autoload=no options.
    … …  
    9999
    100100                global $wpdb;
    101                 wp_cache_flush();
     101                $this->flush_cache();
    102102                update_option( 'test_update_option_default', 'value', false );
    103                 wp_cache_flush();
     103                $this->flush_cache();
    104104
    105105                // Populate the alloptions cache, which does not include autoload=no options.
    … …  
    128128                $this->assertTrue( $updated );
    129129
    130                 wp_cache_flush();
     130                $this->flush_cache();
    131131
    132132                // Populate the alloptions cache, which includes autoload=yes options.
    … …  
    153153                $this->assertFalse( $updated );
    154154
    155                 wp_cache_flush();
     155                $this->flush_cache();
    156156
    157157                // Populate the alloptions cache, which includes autoload=yes options.
    … …  
    181181                $this->assertTrue( $updated );
    182182
    183                 wp_cache_flush();
     183                $this->flush_cache();
    184184
    185185                // Populate the alloptions cache, which includes autoload=yes options.
Note: See TracChangeset for help on using the changeset viewer.