summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-08-01 08:33:49 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-08-05 14:17:32 +0200
commitdd9f195afd242c3d6023e8b6afecb73a61a99d60 (patch)
treef3a728fc36447e90a7ca5af120a255dfe00a198e
parent0556e40d3e560695f4aee5f9ef194355f1573e0f (diff)
downloadnextcloud-server-dd9f195afd242c3d6023e8b6afecb73a61a99d60.tar.gz
nextcloud-server-dd9f195afd242c3d6023e8b6afecb73a61a99d60.zip
Add OCS-APIREQUEST header to intergration test calls
-rw-r--r--build/integration/features/bootstrap/BasicStructure.php3
-rw-r--r--build/integration/features/bootstrap/CommentsContext.php3
-rw-r--r--build/integration/features/bootstrap/Sharing.php26
3 files changed, 29 insertions, 3 deletions
diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php
index 80f24c6860b..0b0e5998c4b 100644
--- a/build/integration/features/bootstrap/BasicStructure.php
+++ b/build/integration/features/bootstrap/BasicStructure.php
@@ -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;
diff --git a/build/integration/features/bootstrap/CommentsContext.php b/build/integration/features/bootstrap/CommentsContext.php
index 5c3b0edafac..1d1b47f9736 100644
--- a/build/integration/features/bootstrap/CommentsContext.php
+++ b/build/integration/features/bootstrap/CommentsContext.php
@@ -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));
}
diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php
index 954c273bfc2..3a50b1917aa 100644
--- a/build/integration/features/bootstrap/Sharing.php
+++ b/build/integration/features/bootstrap/Sharing.php
@@ -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',
],
]
);