From 9b64fa7b920d8ab1d713f1cc098c91107fead534 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 21 Oct 2015 12:05:23 +0200 Subject: [PATCH] [provisioning api] losen test Since we have no control of how backends sort their list of users and we also don't want to sort yet another time the test now just checks if the correct number of elements is returned and if they are from the list of group members. --- apps/provisioning_api/tests/userstest.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/provisioning_api/tests/userstest.php b/apps/provisioning_api/tests/userstest.php index 673383edae..b43041bbbf 100644 --- a/apps/provisioning_api/tests/userstest.php +++ b/apps/provisioning_api/tests/userstest.php @@ -151,7 +151,20 @@ class UsersTest extends TestCase { $this->assertInstanceOf('OC_OCS_Result', $result); $this->assertTrue($result->succeeded()); - $this->assertEquals(['users' => array_slice($uids, 1, 2)], $result->getData()); + + // Disable this test for now since sorting is not done the same on all backends + //$this->assertEquals(['users' => array_slice($uids, 1, 2)], $result->getData()); + + $this->assertCount(2, $result->getData()['users']); + + $counter = 0; + foreach ($uids as $uid) { + if (in_array($uid, $result->getData()['users'], true)) { + $counter += 1; + } + } + + $this->assertEquals(2, $counter); } public function testGetUsersNoUser() {