diff options
-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 */ |