Make WordPress Core

Changeset 30320


Ignore:
Timestamp:
11/13/2014 01:59:49 AM (9 years ago)
Author:
boonebgorges
Message:

Manually delete fixture in test_mysqli_flush_sync().

This test creates a dummy post and subsequently runs a query containing
DROP PROCEDURE. This latter query implies a COMMIT, which means that the
post is not cleaned up for later tests. Manually deleting the post with
wp_delete_post() solves this problem.

Fixes #28155.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/db.php

    r30297 r30320  
    483483        }
    484484
    485         $this->factory->post->create();
     485        $post_id = $this->factory->post->create();
    486486
    487487        $this->assertNotEmpty( $wpdb->get_results( 'CALL `test_mysqli_flush_sync_procedure`' ) );
    488488        $this->assertNotEmpty( $wpdb->get_results( "SELECT ID FROM `{$wpdb->posts}` LIMIT 1" ) );
    489489
     490        // DROP PROCEDURE will cause a COMMIT, so we delete the post manually before that happens.
     491        wp_delete_post( $post_id, true );
     492
    490493        $wpdb->query( 'DROP PROCEDURE IF EXISTS `test_mysqli_flush_sync_procedure`' );
    491494        $wpdb->suppress_errors( $suppress );
Note: See TracChangeset for help on using the changeset viewer.