Changeset 27086
- Timestamp:
- 02/03/2014 10:39:47 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r27041 r27086 36 36 $this->expectedDeprecated(); 37 37 $wpdb->query( 'ROLLBACK' ); 38 remove_filter( 'query', array( $this, '_create_temporary_table ' ) );39 remove_filter( 'query', array( $this, '_drop_temporary_table ' ) );38 remove_filter( 'query', array( $this, '_create_temporary_tables' ) ); 39 remove_filter( 'query', array( $this, '_drop_temporary_tables' ) ); 40 40 remove_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); 41 41 } … … 65 65 $wpdb->query( 'SET autocommit = 0;' ); 66 66 $wpdb->query( 'START TRANSACTION;' ); 67 add_filter( 'query', array( $this, '_create_temporary_table ' ) );68 add_filter( 'query', array( $this, '_drop_temporary_table ' ) );69 } 70 71 function _create_temporary_table ( $query ) {72 if ( 'CREATE TABLE' === substr( $query, 0, 12 ) )73 return substr_replace( $query, 'CREATE TEMPORARY TABLE', 0, 12 );67 add_filter( 'query', array( $this, '_create_temporary_tables' ) ); 68 add_filter( 'query', array( $this, '_drop_temporary_tables' ) ); 69 } 70 71 function _create_temporary_tables( $query ) { 72 if ( 'CREATE TABLE' === substr( trim( $query ), 0, 12 ) ) 73 return substr_replace( trim( $query ), 'CREATE TEMPORARY TABLE', 0, 12 ); 74 74 return $query; 75 75 } 76 76 77 function _drop_temporary_table ( $query ) {78 if ( 'DROP TABLE' === substr( $query, 0, 10 ) )79 return substr_replace( $query, 'DROP TEMPORARY TABLE', 0, 10 );77 function _drop_temporary_tables( $query ) { 78 if ( 'DROP TABLE' === substr( trim( $query ), 0, 10 ) ) 79 return substr_replace( trim( $query ), 'DROP TEMPORARY TABLE', 0, 10 ); 80 80 return $query; 81 81 }
Note: See TracChangeset
for help on using the changeset viewer.