mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-21 08:12:17 +02:00
[ticket/10939] Added tests for phpbb_request::file
PHPBB3-10939
This commit is contained in:
parent
935e717762
commit
aa5f6dffa5
@ -93,6 +93,23 @@ class phpbb_request_test extends phpbb_test_case
|
||||
$this->request->header('SOMEVAR');
|
||||
}
|
||||
|
||||
public function test_file()
|
||||
{
|
||||
$file = $this->request->file('test');
|
||||
$this->assertEquals('file', $file['name']);
|
||||
$this->assertEquals('tmp', $file['tmp_name']);
|
||||
$this->assertEquals(256, $file['size']);
|
||||
$this->assertEquals('application/octet-stream', $file['type']);
|
||||
$this->assertEquals(UPLOAD_ERR_OK, $file['error']);
|
||||
}
|
||||
|
||||
public function test_file_not_exists()
|
||||
{
|
||||
$file = $this->request->file('404');
|
||||
$this->assertTrue(is_array($file));
|
||||
$this->assertTrue(empty($file));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that directly accessing $_POST will trigger
|
||||
* an error.
|
||||
|
Loading…
x
Reference in New Issue
Block a user