1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00

Enable app

This commit is contained in:
Lukas Reschke 2015-07-01 16:21:11 +02:00
parent ff24a91f48
commit 6d84ceaa2f
2 changed files with 5 additions and 3 deletions

View File

@ -13,6 +13,8 @@ if(!class_exists('PHPUnit_Framework_TestCase')) {
require_once('PHPUnit/Autoload.php');
}
OC_App::enable('contacts');
OC_Hook::clear();
OC_Log::$enabled = false;
OCP\Util::connectHook('OCA\Contacts', 'pre_deleteContact', '\OCA\Contacts\Hooks', 'contactDeletion');

View File

@ -42,7 +42,8 @@ class AddressBookProviderTest extends TestCase {
public function setUp() {
parent::setUp();
$this->testUser = uniqid('user_');
$this->testUser = $this->getUniqueID('user_');
// needed because some parts of code call "getRequest()" and "getSession()"
$session = $this->getMockBuilder('\OC\Session\Memory')
->disableOriginalConstructor()
@ -72,11 +73,10 @@ class AddressBookProviderTest extends TestCase {
$this->backend = new Backend\Database($this->testUser);
$this->abinfo = array('displayname' => uniqid('display_'));
$this->ab = new AddressBook($this->backend, $this->abinfo);
$this->provider = new AddressbookProvider($this->ab);
$card = new \OCA\Contacts\VObject\VCard();
$uid = substr(md5(rand().time()), 0, 10);
$uid = substr(md5($this->getUniqueID()), 0, 10);
$card->add('UID', $uid);
$card->add('FN', 'Max Mustermann');
$id = $this->ab->addChild($card);