diff --git a/core/modules/file/src/Tests/RetrieveTemporaryFilesTest.php b/core/modules/file/src/Tests/RetrieveTemporaryFilesTest.php index eae640c..1a1abba 100644 --- a/core/modules/file/src/Tests/RetrieveTemporaryFilesTest.php +++ b/core/modules/file/src/Tests/RetrieveTemporaryFilesTest.php @@ -6,6 +6,7 @@ */ namespace Drupal\file\Tests; +use Drupal\file\Entity\File; /** * Provides tests for retrieving temporary files. @@ -35,12 +36,14 @@ public function setUp() { // Create an entry for the user with the date change. $file_array = array('uid' => 2, 'uri' => 'public://example1.txt', 'status' => 2, 'changed' => REQUEST_TIME); - db_insert('file_managed')->fields($file_array)->execute(); + $file = File::create($file_array); + $file->save(); // Create an entry for the user with an indication of the old date of the // change. $file_array = array('uid' => 2, 'uri' => 'public://example2.txt', 'status' => 2, 'changed' => REQUEST_TIME - ($max_age * 2)); - db_insert('file_managed')->fields($file_array)->execute(); + $file = File::create($file_array); + $file->save(); } /**