mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-18 21:48:24 -04:00
return invalid data error on API instead of exception
This commit is contained in:
@@ -436,8 +436,6 @@ class ControllerTest extends PHPUnit_Framework_TestCase
|
||||
* silently removed, check that this case is handled
|
||||
*
|
||||
* @runInSeparateProcess
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionCode 90
|
||||
*/
|
||||
public function testCreateBrokenUpload()
|
||||
{
|
||||
@@ -449,7 +447,12 @@ class ControllerTest extends PHPUnit_Framework_TestCase
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
$_SERVER['REMOTE_ADDR'] = '::1';
|
||||
$this->assertFalse($this->_data->exists(Helper::getPasteId()), 'paste does not exists before posting data');
|
||||
ob_start();
|
||||
new Controller;
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$response = json_decode($content, true);
|
||||
$this->assertEquals(1, $response['status'], 'outputs error status');
|
||||
$this->assertFalse($this->_data->exists(Helper::getPasteId()), 'paste exists after posting data');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user