diff options
author | Sergio Bertolin <sbertolin@solidgear.es> | 2015-10-06 16:37:55 +0000 |
---|---|---|
committer | Sergio Bertolin <sbertolin@solidgear.es> | 2015-10-06 16:37:55 +0000 |
commit | bb9f5686543531ccb55a59eb003cd6f83991b398 (patch) | |
tree | 16017a35f70c0c925c2579a1127c2d19a9c211e7 /build/integration/features/bootstrap/FeatureContext.php | |
parent | 319e61f0eabe02847c4dccdb9db86dc3181d7540 (diff) | |
download | nextcloud-server-bb9f5686543531ccb55a59eb003cd6f83991b398.tar.gz nextcloud-server-bb9f5686543531ccb55a59eb003cd6f83991b398.zip |
lists getting ready
Diffstat (limited to 'build/integration/features/bootstrap/FeatureContext.php')
-rw-r--r-- | build/integration/features/bootstrap/FeatureContext.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index 9676fc8ca40..99d030fa6fc 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -59,6 +59,43 @@ class FeatureContext extends BehatContext { } /** + * Parses the xml answer to get the array of users returned. + */ + public function getArrayOfUsersResponded($resp) { + $listCheckedElements = $resp->xml()->data[0]->users[0]->element; + $extractedElementsArray = json_decode( json_encode($listCheckedElements) , 1); + return $extractedElementsArray; + } + + + /** + * Parses the xml answer to get the array of groups returned. + */ + /* + public function getArrayOfGroupsResponded(){ + $listCheckedElements = $this->$response->xml()->data[0]->groups[0]->element; + $extractedElementsArray = json_decode( json_encode($listCheckedElements) , 1); + return $extractedElementsArray; + } + */ + + + + /** + * @Then /^users returned are$/ + * @param \Behat\Gherkin\Node\TableNode|null $formData + */ + public function theUsersShouldBe($usersList) { + if ($usersList instanceof \Behat\Gherkin\Node\TableNode) { + $users = $usersList->getRows()[0]; + $respondedArray = $this->getArrayOfUsersResponded($this->response); + PHPUnit_Framework_Assert::assertEquals($users, $respondedArray); + } + + } + + + /** * @Then /^the OCS status code should be "([^"]*)"$/ */ public function theOCSStatusCodeShouldBe($statusCode) { |