made all php unit tests pass again

This commit is contained in:
El RIDO
2019-05-10 07:55:39 +02:00
parent 59569bf9fc
commit 700f8a0ea7
11 changed files with 158 additions and 255 deletions

View File

@@ -93,13 +93,13 @@ class RequestTest extends PHPUnit_Framework_TestCase
$_SERVER['REQUEST_METHOD'] = 'PUT';
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
$file = tempnam(sys_get_temp_dir(), 'FOO');
file_put_contents($file, 'data=foo');
file_put_contents($file, 'ct=foo');
Request::setInputStream($file);
$request = new Request;
unlink($file);
$this->assertTrue($request->isJsonApiCall(), 'is JSON Api call');
$this->assertEquals('create', $request->getOperation());
$this->assertEquals('foo', $request->getParam('data'));
$this->assertEquals('foo', $request->getParam('ct'));
}
public function testApiCreateAlternative()
@@ -107,11 +107,11 @@ class RequestTest extends PHPUnit_Framework_TestCase
$this->reset();
$_SERVER['REQUEST_METHOD'] = 'POST';
$_SERVER['HTTP_ACCEPT'] = 'application/json, text/javascript, */*; q=0.01';
$_POST['attachment'] = 'foo';
$_POST['ct'] = 'foo';
$request = new Request;
$this->assertTrue($request->isJsonApiCall(), 'is JSON Api call');
$this->assertEquals('create', $request->getOperation());
$this->assertEquals('foo', $request->getParam('attachment'));
$this->assertEquals('foo', $request->getParam('ct'));
}
public function testApiRead()