diff options
author | Tobia De Koninck <tobia@ledfan.be> | 2017-10-01 16:48:15 +0300 |
---|---|---|
committer | Tobia De Koninck <tobia@ledfan.be> | 2018-02-08 16:19:49 +0300 |
commit | a49fb2c0777c877f1c92c07c5d01831439abe432 (patch) | |
tree | a15de6b4d07471e3a3728bc8abf27a6109d45640 /tests/integration | |
parent | 6ffad0a7a6bdca3495c341fad082c6adf245e9b1 (diff) |
Manually register System addresbook after creating it to make sure tests works on fresh db
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/db/PresenceMapperTest.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/integration/db/PresenceMapperTest.php b/tests/integration/db/PresenceMapperTest.php index de905f7..c4e322f 100644 --- a/tests/integration/db/PresenceMapperTest.php +++ b/tests/integration/db/PresenceMapperTest.php @@ -5,6 +5,7 @@ namespace OCA\OJSXC\Db; use OCA\OJSXC\Db\Presence as PresenceEntity; use OCA\OJSXC\NewContentContainer; use OCA\OJSXC\Utility\MapperTestUtility; +use OCA\DAV\AppInfo\Application as DavApp; $time = 0; @@ -53,10 +54,6 @@ class PresenceMapperTest extends MapperTestUtility } } - /** - * @before - * TODO explciclty call this function - */ public function setupContactsStoreAPI() { foreach (\OC::$server->getUserManager()->search('') as $user) { @@ -69,7 +66,6 @@ class PresenceMapperTest extends MapperTestUtility $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 */ @@ -81,6 +77,10 @@ class PresenceMapperTest extends MapperTestUtility $syncService->updateUser($user); } + $cm = \OC::$server->getContactsManager(); + $davApp = new DavApp(); + $davApp->setupSystemContactsProvider($cm); + \OC_User::setIncognitoMode(false); \OC::$server->getDatabaseConnection()->executeQuery("DELETE FROM *PREFIX*ojsxc_stanzas"); @@ -328,6 +328,7 @@ class PresenceMapperTest extends MapperTestUtility */ public function testGetConnectedUsers($inputs, $expected) { + $this->setupContactsStoreAPI(); foreach ($inputs as $input) { $this->mapper->setPresence($input); } |