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. git-svn-id: https://develop.svn.wordpress.org/trunk@30320 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ca39f65025
commit
f5d88c355e
@ -482,11 +482,14 @@ class Tests_DB extends WP_UnitTestCase {
|
||||
$this->markTestSkipped( 'procedure could not be created (missing privileges?)' );
|
||||
}
|
||||
|
||||
$this->factory->post->create();
|
||||
$post_id = $this->factory->post->create();
|
||||
|
||||
$this->assertNotEmpty( $wpdb->get_results( 'CALL `test_mysqli_flush_sync_procedure`' ) );
|
||||
$this->assertNotEmpty( $wpdb->get_results( "SELECT ID FROM `{$wpdb->posts}` LIMIT 1" ) );
|
||||
|
||||
// DROP PROCEDURE will cause a COMMIT, so we delete the post manually before that happens.
|
||||
wp_delete_post( $post_id, true );
|
||||
|
||||
$wpdb->query( 'DROP PROCEDURE IF EXISTS `test_mysqli_flush_sync_procedure`' );
|
||||
$wpdb->suppress_errors( $suppress );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user