function FileFieldTestBase::getLastFileId

Retrieves the fid of the last inserted file.

1 call to FileFieldTestBase::getLastFileId()
FileManagedFileElementTest::testManagedFile in drupal/core/modules/file/lib/Drupal/file/Tests/FileManagedFileElementTest.php
Tests the managed_file element type.

File

drupal/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php, line 50
Definition of Drupal\file\Tests\FileFieldTestBase.

Class

FileFieldTestBase
Provides methods specifically for testing File module's field handling.

Namespace

Drupal\file\Tests

Code

function getLastFileId() {
  return (int) db_query('SELECT MAX(fid) FROM {file_managed}')
    ->fetchField();
}