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

Issue #2426729 by chx: NodeSaveTest hardwires SQL

parent 00df5bad
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,11 @@ protected function setUp() {
*/
function testImport() {
// Node ID must be a number that is not in the database.
$max_nid = db_query('SELECT MAX(nid) FROM {node}')->fetchField();
$nids = \Drupal::entityManager()->getStorage('node')->getQuery()
->sort('nid', 'DESC')
->range(0, 1)
->execute();
$max_nid = reset($nids);
$test_nid = $max_nid + mt_rand(1000, 1000000);
$title = $this->randomMachineName(8);
$node = array(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment