|
@@ -278,19 +278,19 @@ class ControllerTest extends TestCase
|
|
|
*/
|
|
*/
|
|
|
public function testCreateOverSize()
|
|
public function testCreateOverSize()
|
|
|
{
|
|
{
|
|
|
- $options = parse_ini_file(CONF, true);
|
|
|
|
|
|
|
+ $options = parse_ini_file(CONF, true);
|
|
|
$options['main']['sizelimit'] = 1000;
|
|
$options['main']['sizelimit'] = 1000;
|
|
|
- $options['traffic']['limit'] = 0;
|
|
|
|
|
|
|
+ $options['traffic']['limit'] = 0;
|
|
|
Helper::createIniFile(CONF, $options);
|
|
Helper::createIniFile(CONF, $options);
|
|
|
$paste = Helper::getPastePost();
|
|
$paste = Helper::getPastePost();
|
|
|
// add some extra authenticated data, could be a hypothetical future cryptographic hash, exceeding the sizelimit
|
|
// add some extra authenticated data, could be a hypothetical future cryptographic hash, exceeding the sizelimit
|
|
|
$paste['adata'][] = str_repeat('0', $options['main']['sizelimit']);
|
|
$paste['adata'][] = str_repeat('0', $options['main']['sizelimit']);
|
|
|
- $file = Helper::createTempFile();
|
|
|
|
|
|
|
+ $file = Helper::createTempFile();
|
|
|
file_put_contents($file, json_encode($paste));
|
|
file_put_contents($file, json_encode($paste));
|
|
|
Request::setInputStream($file);
|
|
Request::setInputStream($file);
|
|
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
|
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
|
|
|
- $_SERVER['REQUEST_METHOD'] = 'POST';
|
|
|
|
|
- $_SERVER['REMOTE_ADDR'] = '::1';
|
|
|
|
|
|
|
+ $_SERVER['REQUEST_METHOD'] = 'POST';
|
|
|
|
|
+ $_SERVER['REMOTE_ADDR'] = '::1';
|
|
|
ob_start();
|
|
ob_start();
|
|
|
new Controller;
|
|
new Controller;
|
|
|
$content = ob_get_contents();
|
|
$content = ob_get_contents();
|