diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-11-14 11:43:11 +0300 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-11-24 20:36:07 +0300 |
commit | 223bca73abc9c4f773dac77eb8eef01bc84fe20d (patch) | |
tree | 4ab5b67d7a523243efcef8b4a3d015aea7778e07 /build | |
parent | ba2d6def756da776e37121ff4334a1e23bb15abf (diff) |
Backport integration test functions from #26610
Partial backport of the integration tests from #26610
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/Sharing.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php index 2c8c1798250..973d3bc3c92 100644 --- a/build/integration/features/bootstrap/Sharing.php +++ b/build/integration/features/bootstrap/Sharing.php @@ -254,6 +254,7 @@ trait Sharing { * @param string $filename */ public function checkSharedFileInResponse($filename){ + $filename = ltrim($filename, '/'); PHPUnit_Framework_Assert::assertEquals(True, $this->isFieldInResponse('file_target', "/$filename")); } @@ -263,10 +264,31 @@ trait Sharing { * @param string $filename */ public function checkSharedFileNotInResponse($filename){ + $filename = ltrim($filename, '/'); PHPUnit_Framework_Assert::assertEquals(False, $this->isFieldInResponse('file_target', "/$filename")); } /** + * @Then /^File "([^"]*)" should be included as path in the response$/ + * + * @param string $filename + */ + public function checkSharedFileAsPathInResponse($filename){ + $filename = ltrim($filename, '/'); + PHPUnit_Framework_Assert::assertEquals(True, $this->isFieldInResponse('path', "/$filename")); + } + + /** + * @Then /^File "([^"]*)" should not be included as path in the response$/ + * + * @param string $filename + */ + public function checkSharedFileAsPathNotInResponse($filename){ + $filename = ltrim($filename, '/'); + PHPUnit_Framework_Assert::assertEquals(False, $this->isFieldInResponse('path', "/$filename")); + } + + /** * @Then /^User "([^"]*)" should be included in the response$/ * * @param string $user @@ -385,6 +407,14 @@ trait Sharing { } /** + * @Then /^the response contains ([0-9]+) entries$/ + */ + public function checkingTheResponseEntriesCount($count){ + $actualCount = count($this->response->xml()->data[0]); + PHPUnit_Framework_Assert::assertEquals($count, $actualCount); + } + + /** * @Then /^Share fields of last share match with$/ * @param \Behat\Gherkin\Node\TableNode|null $body */ |