mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-01 13:24:10 +01:00
Enable app
This commit is contained in:
parent
ff24a91f48
commit
6d84ceaa2f
@ -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');
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user