Make WordPress Core

Changeset 34720


Ignore:
Timestamp:
09/30/2015 01:27:09 PM (6 years ago)
Author:
boonebgorges
Message:

Fix db_version juggling during non-multisite tests.

Continuing with the "code is poetry" theme after [34719], we need to continue
to update the option in the database on non-multisite in this
wp_insert_term() test.

See #31130.

Location:
trunk/tests/phpunit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase.php

    r34719 r34720  
    1414    protected static $hooks_saved = array();
    1515    protected static $ignore_files;
     16
     17    protected $db_version;
    1618
    1719    /**
     
    6567         * See #31130.
    6668         */
     69        $this->db_version = get_option( 'db_version' );
    6770        if ( is_multisite() ) {
    68             $this->db_version = get_option( 'db_version' );
    6971            add_filter( 'pre_option_db_version', array( $this, 'db_version' ) );
    7072        }
  • trunk/tests/phpunit/tests/term/wpInsertTerm.php

    r34719 r34720  
    470470    public function test_wp_insert_term_duplicate_slug_different_taxonomy_before_410_schema_change() {
    471471
    472         $_db_version = $this->db_version;
    473         $this->db_version = 30055;
     472        // See #31130.
     473        $old_db_version = 30055;
     474        if ( is_multisite() ) {
     475            $_db_version = $this->db_version;
     476            $this->db_version = $old_db_version;
     477        } else {
     478            update_option( 'db_version', $old_db_version );
     479        }
    474480
    475481        register_taxonomy( 'wptests_tax', 'post' );
     
    498504        $this->assertNotEquals( $new_term->term_id, $term->term_id );
    499505
    500         $this->db_version = $_db_version;
     506        if ( is_multisite() ) {
     507            $this->db_version = $_db_version;
     508        }
     509
    501510        _unregister_taxonomy( 'wptests_tax', 'post' );
    502511    }
Note: See TracChangeset for help on using the changeset viewer.