Properly suppress errors in test_empty_where_on_update(), which expects an empty WHERE clause.

see #26106.

git-svn-id: https://develop.svn.wordpress.org/trunk@29701 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2014-09-04 04:30:11 +00:00
parent d53bee91c6
commit 445b364f5b

View File

@ -444,7 +444,7 @@ class Tests_DB extends WP_UnitTestCase {
*/ */
function test_empty_where_on_update() { function test_empty_where_on_update() {
global $wpdb; global $wpdb;
$show = $wpdb->show_errors(false); $suppress = $wpdb->suppress_errors( true );
$wpdb->update( $wpdb->posts, array( 'post_name' => 'burrito' ), array() ); $wpdb->update( $wpdb->posts, array( 'post_name' => 'burrito' ), array() );
$expected1 = "UPDATE `{$wpdb->posts}` SET `post_name` = 'burrito' WHERE "; $expected1 = "UPDATE `{$wpdb->posts}` SET `post_name` = 'burrito' WHERE ";
@ -456,6 +456,6 @@ class Tests_DB extends WP_UnitTestCase {
$expected2 = "UPDATE `{$wpdb->posts}` SET `post_name` = 'burrito' WHERE `post_status` = 'taco'"; $expected2 = "UPDATE `{$wpdb->posts}` SET `post_name` = 'burrito' WHERE `post_status` = 'taco'";
$this->assertEmpty( $wpdb->last_error ); $this->assertEmpty( $wpdb->last_error );
$this->assertEquals( $expected2, $wpdb->last_query ); $this->assertEquals( $expected2, $wpdb->last_query );
$wpdb->show_errors( $show ); $wpdb->suppress_errors( $suppress );
} }
} }