mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/10939] Added tests for phpbb_request::file
PHPBB3-10939
This commit is contained in:
parent
935e717762
commit
aa5f6dffa5
1 changed files with 17 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue