protected function UploadFileServiceTest::getSourceTestFilePath in GraphQL 8.4
Gets the file path of the source file.
Parameters
string $filename: Filename of the source file to be get the file path for.
Return value
string File path of the source file.
1 call to UploadFileServiceTest::getSourceTestFilePath()
- UploadFileServiceTest::getUploadedFile in tests/
src/ Kernel/ Framework/ UploadFileServiceTest.php - Helper method to prepare the UploadedFile depending on core version.
File
- tests/
src/ Kernel/ Framework/ UploadFileServiceTest.php, line 39
Class
- UploadFileServiceTest
- Tests file uploads that should be mapped to a field in a resolver.
Namespace
Drupal\Tests\graphql\Kernel\FrameworkCode
protected function getSourceTestFilePath(string $filename) : string {
$file_system = $this->container
->get('file_system');
// Create dummy file, since symfony will test if it exists.
$filepath = $file_system
->getTempDirectory() . '/' . $filename;
touch($filepath);
return $filepath;
}