本文整理匯總了PHP中OC_Group::clearBackends方法的典型用法代碼示例。如果您正苦於以下問題:PHP OC_Group::clearBackends方法的具體用法?PHP OC_Group::clearBackends怎麽用?PHP OC_Group::clearBackends使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OC_Group
的用法示例。
在下文中一共展示了OC_Group::clearBackends方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
public function setUp()
{
OC_User::clearBackends();
OC_User::useBackend('dummy');
$this->user1 = uniqid('user1_');
$this->user2 = uniqid('user2_');
$this->user3 = uniqid('user3_');
$this->user4 = uniqid('user4_');
OC_User::createUser($this->user1, 'pass');
OC_User::createUser($this->user2, 'pass');
OC_User::createUser($this->user3, 'pass');
OC_User::createUser($this->user4, 'pass');
OC_User::setUserId($this->user1);
OC_Group::clearBackends();
OC_Group::useBackend(new OC_Group_Dummy());
$this->group1 = uniqid('group_');
$this->group2 = uniqid('group_');
OC_Group::createGroup($this->group1);
OC_Group::createGroup($this->group2);
OC_Group::addToGroup($this->user1, $this->group1);
OC_Group::addToGroup($this->user2, $this->group1);
OC_Group::addToGroup($this->user3, $this->group1);
OC_Group::addToGroup($this->user2, $this->group2);
OC_Group::addToGroup($this->user4, $this->group2);
OCP\Share::registerBackend('test', 'Test_Share_Backend');
OC_Hook::clear('OCP\\Share');
OC::registerShareHooks();
$this->resharing = OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes');
OC_Appconfig::setValue('core', 'shareapi_allow_resharing', 'yes');
// 20 Minutes in the past, 20 minutes in the future.
$now = time();
$dateFormat = 'Y-m-d H:i:s';
$this->dateInPast = date($dateFormat, $now - 20 * 60);
$this->dateInFuture = date($dateFormat, $now + 20 * 60);
}
示例2: setUp
public function setUp()
{
OC_User::clearBackends();
OC_User::useBackend('dummy');
$this->user1 = uniqid('user1_');
$this->user2 = uniqid('user2_');
$this->user3 = uniqid('user3_');
$this->user4 = uniqid('user4_');
OC_User::createUser($this->user1, 'pass');
OC_User::createUser($this->user2, 'pass');
OC_User::createUser($this->user3, 'pass');
OC_User::createUser($this->user4, 'pass');
OC_User::setUserId($this->user1);
OC_Group::clearBackends();
OC_Group::useBackend(new OC_Group_Dummy());
$this->group1 = uniqid('group_');
$this->group2 = uniqid('group_');
OC_Group::createGroup($this->group1);
OC_Group::createGroup($this->group2);
OC_Group::addToGroup($this->user1, $this->group1);
OC_Group::addToGroup($this->user2, $this->group1);
OC_Group::addToGroup($this->user3, $this->group1);
OC_Group::addToGroup($this->user2, $this->group2);
OC_Group::addToGroup($this->user4, $this->group2);
OCP\Share::registerBackend('test', 'Test_Share_Backend');
OC_Hook::clear('OCP\\Share');
OC::registerShareHooks();
}
示例3: setUp
protected function setUp()
{
parent::setUp();
\OC_User::clearBackends();
\OC_User::useBackend('dummy');
$this->user1 = $this->getUniqueID('user1_');
$this->user2 = $this->getUniqueID('user2_');
$this->user3 = $this->getUniqueID('user3_');
$this->user4 = $this->getUniqueID('user4_');
$this->user5 = $this->getUniqueID('user5_');
$this->user6 = $this->getUniqueID('user6_');
$this->groupAndUser = $this->getUniqueID('groupAndUser_');
\OC::$server->getUserManager()->createUser($this->user1, 'pass');
\OC::$server->getUserManager()->createUser($this->user2, 'pass');
\OC::$server->getUserManager()->createUser($this->user3, 'pass');
\OC::$server->getUserManager()->createUser($this->user4, 'pass');
\OC::$server->getUserManager()->createUser($this->user5, 'pass');
\OC::$server->getUserManager()->createUser($this->user6, 'pass');
// no group
\OC::$server->getUserManager()->createUser($this->groupAndUser, 'pass');
\OC_User::setUserId($this->user1);
\OC_Group::clearBackends();
\OC_Group::useBackend(new \Test\Util\Group\Dummy());
$this->group1 = $this->getUniqueID('group1_');
$this->group2 = $this->getUniqueID('group2_');
\OC_Group::createGroup($this->group1);
\OC_Group::createGroup($this->group2);
\OC_Group::createGroup($this->groupAndUser);
\OC_Group::addToGroup($this->user1, $this->group1);
\OC_Group::addToGroup($this->user2, $this->group1);
\OC_Group::addToGroup($this->user3, $this->group1);
\OC_Group::addToGroup($this->user2, $this->group2);
\OC_Group::addToGroup($this->user4, $this->group2);
\OC_Group::addToGroup($this->user2, $this->groupAndUser);
\OC_Group::addToGroup($this->user3, $this->groupAndUser);
\OCP\Share::registerBackend('test', 'Test\\Share\\Backend');
\OC_Hook::clear('OCP\\Share');
\OC::registerShareHooks();
$this->resharing = \OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_resharing', 'yes');
\OC::$server->getAppConfig()->setValue('core', 'shareapi_allow_resharing', 'yes');
// 20 Minutes in the past, 20 minutes in the future.
$now = time();
$dateFormat = 'Y-m-d H:i:s';
$this->dateInPast = date($dateFormat, $now - 20 * 60);
$this->dateInFuture = date($dateFormat, $now + 20 * 60);
}
示例4: tearDownAfterClass
public static function tearDownAfterClass()
{
// cleanup users
\OC_User::deleteUser(self::TEST_FILES_SHARING_API_USER1);
\OC_User::deleteUser(self::TEST_FILES_SHARING_API_USER2);
\OC_User::deleteUser(self::TEST_FILES_SHARING_API_USER3);
// delete group
\OC_Group::deleteGroup(self::TEST_FILES_SHARING_API_GROUP1);
\OC_Util::tearDownFS();
\OC_User::setUserId('');
Filesystem::tearDown();
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
\OC_Group::clearBackends();
\OC_Group::useBackend(new \OC_Group_Database());
parent::tearDownAfterClass();
}
示例5: tearDownAfterClass
public static function tearDownAfterClass()
{
// cleanup users
$user = \OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER1);
if ($user !== null) {
$user->delete();
}
$user = \OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER2);
if ($user !== null) {
$user->delete();
}
\OC_Util::tearDownFS();
\OC_User::setUserId('');
Filesystem::tearDown();
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
\OC_Group::clearBackends();
\OC_Group::useBackend(new \OC_Group_Database());
parent::tearDownAfterClass();
}
示例6: setUp
protected function setUp()
{
parent::setUp();
\OC_User::clearBackends();
\OC_Group::clearBackends();
}
示例7: setUp
function setUp()
{
OC_Group::clearBackends();
}
示例8: setUp
public function setUp()
{
\OC_User::clearBackends();
\OC_Group::clearBackends();
}