WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/08/2014 03:29:31 PM (5 years ago)
Author:
boonebgorges
Message:

Share fixtures across a number of query-related test classes.

This shaves 10-20 seconds off the running time for the suite.

See #30017.

File:
1 edited

Legend:

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

    r30268 r30276  
    166166        add_filter( 'query', array( $this, '_create_temporary_tables' ) );
    167167        add_filter( 'query', array( $this, '_drop_temporary_tables' ) );
     168    }
     169
     170    /**
     171     * Commit the queries in a transaction.
     172     *
     173     * @since 4.1.0
     174     */
     175    public static function commit_transaction() {
     176        global $wpdb;
     177        $wpdb->query( 'COMMIT;' );
    168178    }
    169179
Note: See TracChangeset for help on using the changeset viewer.