1 file.test FileTestHelper::getLastFileId()

Retrieves the fid of the last inserted file.

Return value

int: File fid.

File

core/modules/file/tests/file.test, line 186
Tests for file.module.

Class

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

Code

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