Changeset 29664 for trunk/tests/phpunit/tests/db.php
- Timestamp:
- 09/02/2014 04:55:17 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/db.php
r28814 r29664 439 439 440 440 /** 441 * wpdb::update() requires a WHERE condition. 441 442 * 442 443 * @ticket 26106 443 444 */ 444 function test_empty_where() { 445 global $wpdb; 445 function test_empty_where_on_update() { 446 global $wpdb; 447 $show = $wpdb->show_errors(false); 446 448 $wpdb->update( $wpdb->posts, array( 'post_name' => 'burrito' ), array() ); 447 449 448 $expected1 = "UPDATE `{$wpdb->posts}` SET `post_name` = 'burrito'"; 450 $expected1 = "UPDATE `{$wpdb->posts}` SET `post_name` = 'burrito' WHERE "; 451 $this->assertNotEmpty( $wpdb->last_error ); 449 452 $this->assertEquals( $expected1, $wpdb->last_query ); 450 453 … … 452 455 453 456 $expected2 = "UPDATE `{$wpdb->posts}` SET `post_name` = 'burrito' WHERE `post_status` = 'taco'"; 457 $this->assertEmpty( $wpdb->last_error ); 454 458 $this->assertEquals( $expected2, $wpdb->last_query ); 459 $wpdb->show_errors( $show ); 455 460 } 456 461 }
Note: See TracChangeset
for help on using the changeset viewer.