Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2018-04-12 11:57:42 +0300
committerArthur Schiwon <blizzz@arthur-schiwon.de>2018-08-10 00:45:11 +0300
commiteaf352b8d11251becbbd04690af80e04e3b1e35e (patch)
tree8d9f0771440b5762b7575750821b1bfaa09950c4 /build
parentd1a8a909de471eab64bf5fac8d83a6c9fa812b33 (diff)
integration test to ensure entries without displayname don't cause trouble
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/LDAPContext.php17
-rw-r--r--build/integration/ldap_features/ldap-openldap.feature17
2 files changed, 22 insertions, 12 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);
}
}
}
diff --git a/build/integration/ldap_features/ldap-openldap.feature b/build/integration/ldap_features/ldap-openldap.feature
index 13e011bb0c8..d992f77c67c 100644
--- a/build/integration/ldap_features/ldap-openldap.feature
+++ b/build/integration/ldap_features/ldap-openldap.feature
@@ -17,6 +17,17 @@ Feature: LDAP
| email | alice@nextcloud.ci |
| displayname | Alice |
+ Scenario: Look for a expected LDAP users
+ Given having a valid LDAP configuration
+ And modify LDAP configuration
+ | ldapExpertUsernameAttr | uid |
+ And As an "admin"
+ And sending "GET" to "/cloud/users"
+ Then the OCS status code should be "200"
+ And the "users" result should match
+ | alice | 1 |
+ | ghost | 0 |
+
Scenario: Test group filter with one specific group
Given having a valid LDAP configuration
And modify LDAP configuration
@@ -25,7 +36,7 @@ Feature: LDAP
And As an "admin"
And sending "GET" to "/cloud/groups"
Then the OCS status code should be "200"
- And the group result should
+ And the "groups" result should match
| RedGroup | 1 |
| GreenGroup | 0 |
| BlueGroup | 0 |
@@ -39,7 +50,7 @@ Feature: LDAP
And As an "admin"
And sending "GET" to "/cloud/groups"
Then the OCS status code should be "200"
- And the group result should
+ And the "groups" result should match
| RedGroup | 1 |
| GreenGroup | 1 |
| BlueGroup | 0 |
@@ -53,7 +64,7 @@ Feature: LDAP
And As an "admin"
And sending "GET" to "/cloud/groups"
Then the OCS status code should be "200"
- And the group result should
+ And the "groups" result should match
| RedGroup | 1 |
| GreenGroup | 1 |
| BlueGroup | 1 |