mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/16549] Fix tests
PHPBB3-16549
This commit is contained in:
@@ -186,7 +186,13 @@ class phpbb_fileupload_test extends phpbb_test_case
|
||||
->set_max_filesize(1000);
|
||||
|
||||
copy($this->path . 'jpg', $this->path . 'jpg.jpg');
|
||||
$file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg');
|
||||
// Upload file data should be set to prevent "Undefined array key" PHP 8 warning
|
||||
$filedata = [
|
||||
'size' => 519,
|
||||
'realname' => $this->path . 'jpg.jpg',
|
||||
'type' => false,
|
||||
];
|
||||
$file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg', $filedata);
|
||||
$this->assertEquals(0, count($file->error));
|
||||
$this->assertFalse($file->additional_checks());
|
||||
$this->assertTrue($file->move_file('../tests/upload/fixture/copies', true));
|
||||
@@ -200,7 +206,13 @@ class phpbb_fileupload_test extends phpbb_test_case
|
||||
->set_max_filesize(1000);
|
||||
|
||||
copy($this->path . 'jpg', $this->path . 'jpg.jpg');
|
||||
$file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg');
|
||||
// Upload file data should be set to prevent "Undefined array key" PHP 8 warning
|
||||
$filedata = [
|
||||
'size' => 519,
|
||||
'realname' => $this->path . 'jpg.jpg',
|
||||
'type' => false,
|
||||
];
|
||||
$file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg', $filedata);
|
||||
$this->assertEquals(0, count($file->error));
|
||||
$this->assertFalse($file->move_file('../tests/upload/fixture'));
|
||||
$this->assertFalse($file->get('file_moved'));
|
||||
@@ -215,7 +227,13 @@ class phpbb_fileupload_test extends phpbb_test_case
|
||||
|
||||
copy($this->path . 'jpg', $this->path . 'jpg.jpg');
|
||||
copy($this->path . 'jpg', $this->path . 'copies/jpg.jpg');
|
||||
$file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg');
|
||||
// Upload file data should be set to prevent "Undefined array key" PHP 8 warning
|
||||
$filedata = [
|
||||
'size' => 519,
|
||||
'realname' => $this->path . 'jpg.jpg',
|
||||
'type' => false,
|
||||
];
|
||||
$file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg', $filedata);
|
||||
$this->assertEquals(0, count($file->error));
|
||||
$file->move_file('../tests/upload/fixture/copies', true);
|
||||
$this->assertEquals(0, count($file->error));
|
||||
|
Reference in New Issue
Block a user