You are here

protected function FileManagedFileElementTest::getLastFileId in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php \Drupal\Tests\file\FunctionalJavascript\FileManagedFileElementTest::getLastFileId()
  2. 10 core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php \Drupal\Tests\file\FunctionalJavascript\FileManagedFileElementTest::getLastFileId()

Retrieves the fid of the last inserted file.

1 call to FileManagedFileElementTest::getLastFileId()
FileManagedFileElementTest::testManagedFile in core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php
Tests the managed_file element type.

File

core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php, line 112

Class

FileManagedFileElementTest
Tests the 'managed_file' element type.

Namespace

Drupal\Tests\file\FunctionalJavascript

Code

protected function getLastFileId() {
  return (int) \Drupal::entityQueryAggregate('file')
    ->accessCheck(FALSE)
    ->aggregate('fid', 'max')
    ->execute()[0]['fid_max'];
}