Make WordPress Core


Ignore:
Timestamp:
07/07/2016 04:47:25 PM (10 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

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

    r37358 r38005  
    895895         */
    896896        public function test_wp_insert_user_with_invalid_user_id() {
     897                global $wpdb;
     898                $max_user = $wpdb->get_var( "SELECT MAX(ID) FROM $wpdb->users" );
     899
    897900                $u = wp_insert_user( array(
    898                         'ID' => 123,
     901                        'ID' => $max_user + 1,
    899902                        'user_login' => 'whatever',
    900903                        'user_email' => 'whatever@example.com',
Note: See TracChangeset for help on using the changeset viewer.