1
0
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:
Fyorl 2012-08-20 21:40:53 +01:00
parent 935e717762
commit aa5f6dffa5

View File

@ -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.