]> source.dussan.org Git - nextcloud-server.git/commitdiff
Request requires a second parameter
authorThomas Müller <thomas.mueller@tmit.eu>
Mon, 9 Feb 2015 20:58:54 +0000 (21:58 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Mon, 9 Feb 2015 22:06:55 +0000 (23:06 +0100)
tests/lib/appframework/controller/OCSControllerTest.php

index 8f8d57ef68eb69c42811c6ddfa79dd1ad315f161..3b4de1d7a056f5acb8dfa63c451152a8f26bd416 100644 (file)
@@ -36,12 +36,13 @@ class OCSControllerTest extends \Test\TestCase {
 
        public function testCors() {
                $request = new Request(
-                       array('server' => array('HTTP_ORIGIN' => 'test'))
+                       array('server' => array('HTTP_ORIGIN' => 'test')),
+                       $this->getMock('\OCP\Security\ISecureRandom')
                );
-               $this->controller = new ChildOCSController('app', $request, 'verbs',
+               $controller = new ChildOCSController('app', $request, 'verbs',
                        'headers', 100);
 
-               $response = $this->controller->preflightedCors();
+               $response = $controller->preflightedCors();
 
                $headers = $response->getHeaders();
 
@@ -54,7 +55,10 @@ class OCSControllerTest extends \Test\TestCase {
 
 
        public function testXML() {
-               $controller = new ChildOCSController('app', new Request);
+               $controller = new ChildOCSController('app', new Request(
+                       [],
+                       $this->getMock('\OCP\Security\ISecureRandom')
+               ));
                $expected = "<?xml version=\"1.0\"?>\n" .
                "<ocs>\n" .
                " <meta>\n" .
@@ -80,7 +84,10 @@ class OCSControllerTest extends \Test\TestCase {
 
 
        public function testXMLDataResponse() {
-               $controller = new ChildOCSController('app', new Request);
+               $controller = new ChildOCSController('app', new Request(
+                       [],
+                       $this->getMock('\OCP\Security\ISecureRandom')
+               ));
                $expected = "<?xml version=\"1.0\"?>\n" .
                "<ocs>\n" .
                " <meta>\n" .
@@ -106,7 +113,10 @@ class OCSControllerTest extends \Test\TestCase {
 
 
        public function testJSON() {
-               $controller = new ChildOCSController('app', new Request);
+               $controller = new ChildOCSController('app', new Request(
+                       [],
+                       $this->getMock('\OCP\Security\ISecureRandom')
+               ));
                $expected = '{"status":"OK","statuscode":400,"message":"OK",' .
                            '"totalitems":"","itemsperpage":"","data":{"test":"hi"}}';
                $params = [