issue with php8.1 and new full_path key found in $_FILES, fixes #295

This commit is contained in:
Milos Stojanovic
2022-01-13 11:25:05 +01:00
parent d3b23cdc95
commit c158aa37aa
2 changed files with 36 additions and 1 deletions

View File

@@ -156,6 +156,31 @@ class UploadTest extends TestCase
]);
}
public function testUploadInvalidFile()
{
$this->signIn('john@example.com', 'john123');
$file = [
'tmp_name' => TEST_FILE,
'full_path' => 'something', // new in php 8.1
'name' => 'something',
'type' => 'application/octet-stream',
'size' => 12345,
'error' => 0,
];
$files = ['file' => $file];
$data = [];
$this->sendRequest('GET', '/upload', $data, $files);
$this->assertStatus(204);
$this->sendRequest('POST', '/upload', $data, $files);
$this->assertStatus(422);
}
public function testUploadFileBiggerThanAllowed()
{
$this->signIn('john@example.com', 'john123');