summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-05-24 19:51:01 +0200
committerGitHub <noreply@github.com>2019-05-24 19:51:01 +0200
commitb0c2042a28780bf75fb413e58c06b1d46b829414 (patch)
treed64a11b98fb1b4aaaca35a926c1bc2a0f29e4ac6 /tests
parent67432a2141d83a1bb709e54ec774658e820bc8e2 (diff)
parentb0c030cbb58dca4b2d5ba12a98d073587ec6ad3a (diff)
downloadnextcloud-server-b0c2042a28780bf75fb413e58c06b1d46b829414.tar.gz
nextcloud-server-b0c2042a28780bf75fb413e58c06b1d46b829414.zip
Merge pull request #15714 from nextcloud/fix/204_304_rfc
Check the actual status code for 204 and 304
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/AppFramework/AppTest.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/lib/AppFramework/AppTest.php b/tests/lib/AppFramework/AppTest.php
index b31f4428777..3917cea68dd 100644
--- a/tests/lib/AppFramework/AppTest.php
+++ b/tests/lib/AppFramework/AppTest.php
@@ -90,7 +90,7 @@ class AppTest extends \Test\TestCase {
public function testControllerNameAndMethodAreBeingPassed(){
- $return = array(null, array(), array(), null, new Response());
+ $return = ['HTTP/2.0 200 OK', [], [], null, new Response()];
$this->dispatcher->expects($this->once())
->method('dispatch')
->with($this->equalTo($this->controller),
@@ -130,7 +130,7 @@ class AppTest extends \Test\TestCase {
public function testOutputIsPrinted(){
- $return = [Http::STATUS_OK, [], [], $this->output, new Response()];
+ $return = ['HTTP/2.0 200 OK', [], [], $this->output, new Response()];
$this->dispatcher->expects($this->once())
->method('dispatch')
->with($this->equalTo($this->controller),
@@ -144,16 +144,15 @@ class AppTest extends \Test\TestCase {
public function dataNoOutput() {
return [
- [Http::STATUS_NO_CONTENT],
- [Http::STATUS_NOT_MODIFIED],
+ ['HTTP/2.0 204 No content'],
+ ['HTTP/2.0 304 Not modified'],
];
}
/**
* @dataProvider dataNoOutput
- * @param int $statusCode
*/
- public function testNoOutput($statusCode) {
+ public function testNoOutput(string $statusCode) {
$return = [$statusCode, [], [], $this->output, new Response()];
$this->dispatcher->expects($this->once())
->method('dispatch')
@@ -173,7 +172,7 @@ class AppTest extends \Test\TestCase {
$mock = $this->getMockBuilder('OCP\AppFramework\Http\ICallbackResponse')
->getMock();
- $return = [null, [], [], $this->output, $mock];
+ $return = ['HTTP/2.0 200 OK', [], [], $this->output, $mock];
$this->dispatcher->expects($this->once())
->method('dispatch')
->with($this->equalTo($this->controller),
@@ -188,7 +187,7 @@ class AppTest extends \Test\TestCase {
$this->container['AppName'] = 'core';
$this->container['OC\Core\Controller\Foo'] = $this->controller;
- $return = array(null, array(), array(), null, new Response());
+ $return = ['HTTP/2.0 200 OK', [], [], null, new Response()];
$this->dispatcher->expects($this->once())
->method('dispatch')
->with($this->equalTo($this->controller),
@@ -205,7 +204,7 @@ class AppTest extends \Test\TestCase {
$this->container['AppName'] = 'settings';
$this->container['OC\Settings\Controller\Foo'] = $this->controller;
- $return = array(null, array(), array(), null, new Response());
+ $return = ['HTTP/2.0 200 OK', [], [], null, new Response()];
$this->dispatcher->expects($this->once())
->method('dispatch')
->with($this->equalTo($this->controller),
@@ -222,7 +221,7 @@ class AppTest extends \Test\TestCase {
$this->container['AppName'] = 'bar';
$this->container['OCA\Bar\Controller\Foo'] = $this->controller;
- $return = array(null, array(), array(), null, new Response());
+ $return = ['HTTP/2.0 200 OK', [], [], null, new Response()];
$this->dispatcher->expects($this->once())
->method('dispatch')
->with($this->equalTo($this->controller),