diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-15 12:41:39 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-15 13:11:36 +0200 |
commit | e392f669c09a520e64ea82b7d22350871a05e089 (patch) | |
tree | bb720de259a9fbd6582f5b3a9426ae5894823dc5 /build/integration/features/bootstrap/Sharing.php | |
parent | 6dace7f6adf7721ee043c3a03fc7091eb5a7e82f (diff) | |
download | nextcloud-server-e392f669c09a520e64ea82b7d22350871a05e089.tar.gz nextcloud-server-e392f669c09a520e64ea82b7d22350871a05e089.zip |
Make OCS intergration tests check for CSP
* Very hacky in simple test but at least we test
Diffstat (limited to 'build/integration/features/bootstrap/Sharing.php')
-rw-r--r-- | build/integration/features/bootstrap/Sharing.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php index 3a50b1917aa..a4a9b846cf4 100644 --- a/build/integration/features/bootstrap/Sharing.php +++ b/build/integration/features/bootstrap/Sharing.php @@ -514,5 +514,28 @@ trait Sharing { throw new \Exception('Expected the same link share to be returned'); } } + + /** + * @Then The following headers should be set + * @param \Behat\Gherkin\Node\TableNode $table + * @throws \Exception + */ + public function theFollowingHeadersShouldBeSet(\Behat\Gherkin\Node\TableNode $table) { + foreach($table->getTable() as $header) { + $headerName = $header[0]; + $expectedHeaderValue = $header[1]; + $returnedHeader = $this->response->getHeader($headerName); + if($returnedHeader !== $expectedHeaderValue) { + throw new \Exception( + sprintf( + "Expected value '%s' for header '%s', got '%s'", + $expectedHeaderValue, + $headerName, + $returnedHeader + ) + ); + } + } + } } |