summaryrefslogtreecommitdiffstats
path: root/build/integration/features/bootstrap
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2018-04-12 10:57:42 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2018-08-09 23:45:11 +0200
commiteaf352b8d11251becbbd04690af80e04e3b1e35e (patch)
tree8d9f0771440b5762b7575750821b1bfaa09950c4 /build/integration/features/bootstrap
parentd1a8a909de471eab64bf5fac8d83a6c9fa812b33 (diff)
downloadnextcloud-server-eaf352b8d11251becbbd04690af80e04e3b1e35e.tar.gz
nextcloud-server-eaf352b8d11251becbbd04690af80e04e3b1e35e.zip
integration test to ensure entries without displayname don't cause trouble
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'build/integration/features/bootstrap')
-rw-r--r--build/integration/features/bootstrap/LDAPContext.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/build/integration/features/bootstrap/LDAPContext.php b/build/integration/features/bootstrap/LDAPContext.php
index ce63bc3f698..a4a878b1ca8 100644
--- a/build/integration/features/bootstrap/LDAPContext.php
+++ b/build/integration/features/bootstrap/LDAPContext.php
@@ -141,17 +141,16 @@ class LDAPContext implements Context {
}
/**
- * @Given /^the group result should$/
+ * @Given /^the "([^"]*)" result should match$/
*/
- public function theGroupResultShould(TableNode $expectations) {
- $listReturnedGroups = simplexml_load_string($this->response->getBody())->data[0]->groups[0]->element;
- $extractedGroupsArray = json_decode(json_encode($listReturnedGroups), 1);
-
- foreach($expectations->getRows() as $groupExpectation) {
- if((int)$groupExpectation[1] === 1) {
- PHPUnit_Framework_Assert::assertContains($groupExpectation[0], $extractedGroupsArray);
+ public function theGroupResultShouldMatch(string $type, TableNode $expectations) {
+ $listReturnedElements = simplexml_load_string($this->response->getBody())->data[0]->$type[0]->element;
+ $extractedIDsArray = json_decode(json_encode($listReturnedElements), 1);
+ foreach($expectations->getRows() as $expectation) {
+ if((int)$expectation[1] === 1) {
+ PHPUnit_Framework_Assert::assertContains($expectation[0], $extractedIDsArray);
} else {
- PHPUnit_Framework_Assert::assertNotContains($groupExpectation[0], $extractedGroupsArray);
+ PHPUnit_Framework_Assert::assertNotContains($expectation[0], $extractedIDsArray);
}
}
}