You are here

protected static function DataProviderFileTest::isUploadedFile in RESTful 7.2

Helper function that checks if a file was uploaded via a POST request.

Parameters

string $filename: The name of the file.

Return value

bool TRUE if the file is uploaded. FALSE otherwise.

Overrides DataProviderFile::isUploadedFile

File

tests/modules/restful_test/src/Plugin/resource/DataProvider/DataProviderFileTest.php, line 23
Contains \Drupal\restful_test\Plugin\resource\DataProvider\DataProviderFileTest.

Class

DataProviderFileTest

Namespace

Drupal\restful_test\Plugin\resource\DataProvider

Code

protected static function isUploadedFile($filename) {
  return variable_get('restful_insecure_uploaded_flag', FALSE) || is_uploaded_file($filename);
}