mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-25 19:11:47 +02:00
[ticket/10939] Added tests for phpbb_request::file
PHPBB3-10939
This commit is contained in:
@@ -93,6 +93,23 @@ class phpbb_request_test extends phpbb_test_case
|
|||||||
$this->request->header('SOMEVAR');
|
$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
|
* Checks that directly accessing $_POST will trigger
|
||||||
* an error.
|
* an error.
|
||||||
|
Reference in New Issue
Block a user