]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add OCS-APIREQUEST header to intergration test calls 445/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Mon, 1 Aug 2016 06:33:49 +0000 (08:33 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Fri, 5 Aug 2016 12:17:32 +0000 (14:17 +0200)
build/integration/features/bootstrap/BasicStructure.php
build/integration/features/bootstrap/CommentsContext.php
build/integration/features/bootstrap/Sharing.php

index 80f24c6860bfa1b36f287f0e8d589124ea9ba7c5..0b0e5998c4b37c24ede441421046172166569490 100644 (file)
@@ -157,6 +157,9 @@ trait BasicStructure {
                } else {
                        $options['auth'] = [$this->currentUser, $this->regularUser];
                }
+               $options['headers'] = [
+                       'OCS_APIREQUEST' => 'true'
+               ];
                if ($body instanceof \Behat\Gherkin\Node\TableNode) {
                        $fd = $body->getRowsHash();
                        $options['body'] = $fd;
index 5c3b0edafac4bdd30dff4d64dd1ccae4716f4a23..1d1b47f9736cfdbf6ce715efa6cc82b04497e438 100644 (file)
@@ -191,6 +191,9 @@ class CommentsContext implements \Behat\Behat\Context\Context {
                $options['auth'] = [$user, '123456'];
                $fd = $body->getRowsHash();
                $options['body'] = $fd;
+               $options['headers'] = [
+                       'OCS-APIREQUEST' => 'true',
+               ];
                $client->send($client->createRequest($verb, $this->baseUrl.'/ocs/v1.php/'.$url, $options));
        }
 
index 954c273bfc2fe96a2b8cb4bd711aa358f741ff21..3a50b1917aaed84fafc26cebde61cc40e0cd4484 100644 (file)
@@ -52,7 +52,11 @@ trait Sharing {
        public function asCreatingAShareWith($user, $body) {
                $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares";
                $client = new Client();
-               $options = [];
+               $options = [
+                       'headers' => [
+                               'OCS-APIREQUEST' => 'true',
+                       ],
+               ];
                if ($user === 'admin') {
                        $options['auth'] = $this->adminUser;
                } else {
@@ -160,7 +164,11 @@ trait Sharing {
                $share_id = (string) $this->lastShareData->data[0]->id;
                $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares/$share_id";
                $client = new Client();
-               $options = [];
+               $options = [
+                       'headers' => [
+                               'OCS-APIREQUEST' => 'true',
+                       ],
+               ];
                if ($this->currentUser === 'admin') {
                        $options['auth'] = $this->adminUser;
                } else {
@@ -194,7 +202,11 @@ trait Sharing {
                                                                $permissions = null){
                $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares";
                $client = new Client();
-               $options = [];
+               $options = [
+                       'headers' => [
+                               'OCS-APIREQUEST' => 'true',
+                       ],
+               ];
 
                if ($user === 'admin') {
                        $options['auth'] = $this->adminUser;
@@ -335,6 +347,9 @@ trait Sharing {
                } else {
                        $options['auth'] = [$user1, $this->regularUser];
                }
+               $options['headers'] = [
+                       'OCS-APIREQUEST' => 'true',
+               ];
                $this->response = $client->get($fullUrl, $options);
                if ($this->isUserOrGroupInSharedData($user2, $permissions)){
                        return;
@@ -361,6 +376,9 @@ trait Sharing {
                } else {
                        $options['auth'] = [$user, $this->regularUser];
                }
+               $options['headers'] = [
+                       'OCS-APIREQUEST' => 'true',
+               ];
                $this->response = $client->get($fullUrl, $options);
                if ($this->isUserOrGroupInSharedData($group, $permissions)){
                        return;
@@ -448,6 +466,7 @@ trait Sharing {
                                ],
                                'headers' => [
                                        'Content-Type' => 'application/json',
+                                       'OCS-APIREQUEST' => 'true',
                                ],
                        ]
                );
@@ -465,6 +484,7 @@ trait Sharing {
                                                ],
                                                'headers' => [
                                                        'Content-Type' => 'application/json',
+                                                       'OCS-APIREQUEST' => 'true',
                                                ],
                                        ]
                                );