You are here

protected function FileManagedFileElementTest::getLastFileId in Drupal 8

Same name and namespace in other branches
  1. 9 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')
    ->aggregate('fid', 'max')
    ->execute()[0]['fid_max'];
}