diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-04-24 12:04:29 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-08-09 23:45:12 +0200 |
commit | b069b132267aee0f34da5bf16c828de66ec518ed (patch) | |
tree | fe5fa083a8d240308c6137c2c2fa0e7f17e93eb8 /build/integration/features | |
parent | 0f6d98eed2e45623514ed7445aedf599a9d8d185 (diff) | |
download | nextcloud-server-b069b132267aee0f34da5bf16c828de66ec518ed.tar.gz nextcloud-server-b069b132267aee0f34da5bf16c828de66ec518ed.zip |
convert pagination tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'build/integration/features')
-rw-r--r-- | build/integration/features/bootstrap/LDAPContext.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/LDAPContext.php b/build/integration/features/bootstrap/LDAPContext.php index a4a878b1ca8..5b226753e5c 100644 --- a/build/integration/features/bootstrap/LDAPContext.php +++ b/build/integration/features/bootstrap/LDAPContext.php @@ -167,4 +167,19 @@ class LDAPContext implements Context { } PHPUnit_Framework_Assert::assertTrue(false, 'expected Exception not received'); } + + /** + * @Given /^the "([^"]*)" result should contain "([^"]*)" of$/ + */ + public function theResultShouldContainOf($type, $expectedCount, TableNode $expectations) { + $listReturnedElements = simplexml_load_string($this->response->getBody())->data[0]->$type[0]->element; + $extractedIDsArray = json_decode(json_encode($listReturnedElements), 1); + $uidsFound = 0; + foreach($expectations->getRows() as $expectation) { + if(in_array($expectation[0], $extractedIDsArray)) { + $uidsFound++; + } + } + PHPUnit_Framework_Assert::assertSame((int)$expectedCount, $uidsFound); + } } |