Skip to content
Snippets Groups Projects
Commit 8d4e4121 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2431525 by chx: UserSaveTest hardwires SQL

parent 0aa2a08f
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -21,7 +21,12 @@ class UserSaveTest extends WebTestBase { ...@@ -21,7 +21,12 @@ class UserSaveTest extends WebTestBase {
*/ */
function testUserImport() { function testUserImport() {
// User ID must be a number that is not in the database. // User ID must be a number that is not in the database.
$max_uid = db_query('SELECT MAX(uid) FROM {users}')->fetchField();
$uids = \Drupal::entityManager()->getStorage('user')->getQuery()
->sort('uid', 'DESC')
->range(0, 1)
->execute();
$max_uid = reset($uids);
$test_uid = $max_uid + mt_rand(1000, 1000000); $test_uid = $max_uid + mt_rand(1000, 1000000);
$test_name = $this->randomMachineName(); $test_name = $this->randomMachineName();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment