Tests: Ensure that test for invalid user ID actually uses an invalid user ID.

This prevents false positives when the ID column's incrementor has exceeded the
hardcoded invalid ID.

Fixes #37308.

git-svn-id: https://develop.svn.wordpress.org/trunk@38005 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2016-07-07 16:47:25 +00:00
parent 535f0e3090
commit f41d3cff7d
1 changed files with 4 additions and 1 deletions

View File

@ -894,8 +894,11 @@ class Tests_User extends WP_UnitTestCase {
* @ticket 28004
*/
public function test_wp_insert_user_with_invalid_user_id() {
global $wpdb;
$max_user = $wpdb->get_var( "SELECT MAX(ID) FROM $wpdb->users" );
$u = wp_insert_user( array(
'ID' => 123,
'ID' => $max_user + 1,
'user_login' => 'whatever',
'user_email' => 'whatever@example.com',
'user_pass' => 'password',