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

github.com/nextcloud/jsxc.nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobia De Koninck <tobia@ledfan.be>2017-08-14 16:45:38 +0300
committerTobia De Koninck <tobia@ledfan.be>2018-02-08 16:19:35 +0300
commit8666aa63ada9f7f06d966d366c8714b5bc6c3475 (patch)
tree6b5830a62561afdc6fc775f490b5061da1fa70b5 /tests/integration
parent1b7c93a5adcfec566013ea136c85871e58d76598 (diff)
Fix tests
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/db/PresenceMapperTest.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/integration/db/PresenceMapperTest.php b/tests/integration/db/PresenceMapperTest.php
index a81cdd3..3f03040 100644
--- a/tests/integration/db/PresenceMapperTest.php
+++ b/tests/integration/db/PresenceMapperTest.php
@@ -41,6 +41,47 @@ class PresenceMapperTest extends MapperTestUtility
$this->setValueOfPrivateProperty($this->mapper, 'connectedUsers', []);
$this->newContentContainer = $this->container->query('NewContentContainer');
$this->setValueOfPrivateProperty($this->newContentContainer, 'stanzas', []);
+ foreach (\OC::$server->getUserManager()->search('') as $user) {
+ $user->delete();
+ }
+ }
+
+ protected function tearDown() {
+ foreach (\OC::$server->getUserManager()->search('') as $user) {
+ $user->delete();
+ }
+
+ }
+
+ /**
+ * @before
+ * TODO explciclty call this function
+ */
+ public function setupContactsStoreAPI() {
+ foreach (\OC::$server->getUserManager()->search('') as $user) {
+ $user->delete();
+ }
+
+ $users[] = \OC::$server->getUserManager()->createUser('admin', 'admin');
+ $users[] = \OC::$server->getUserManager()->createUser('derp', 'derp');
+ $users[] = \OC::$server->getUserManager()->createUser('derpina', 'derpina');
+ $users[] = \OC::$server->getUserManager()->createUser('herp', 'herp');
+ $users[] = \OC::$server->getUserManager()->createUser('foo', 'foo');
+
+ \OC_App::loadApp('dav');
+ $currentUser = \OC::$server->getUserManager()->createUser('autotest', 'autotest');
+ \OC::$server->getUserSession()->setUser($currentUser);
+ /** @var \OCA\DAV\CardDAV\SyncService $syncService */
+ $syncService = \OC::$server->query('CardDAVSyncService');
+ $syncService->getLocalSystemAddressBook();
+ $syncService->updateUser($currentUser);
+
+ foreach ($users as $user) {
+ $syncService->updateUser($user);
+ }
+
+ \OC::$server->getDatabaseConnection()->executeQuery("DELETE FROM *PREFIX*ojsxc_stanzas");
+
}
/**