/** * Delete the address book from backend * * @return bool */ public function delete() { if (!$this->hasPermission(\OCP\PERMISSION_DELETE)) { throw new \Exception(self::$l10n->t('You don\'t have permissions to delete the address book.'), Http::STATUS_FORBIDDEN); } return $this->backend->deleteAddressBook($this->getId()); }
public function testDeleteAddressBook() { $this->assertTrue($this->backend->deleteAddressBook('foo')); $this->assertEquals(array(), $this->backend->addressBooks); }