Fix sharing tests
This commit is contained in:
parent
c21d1da01a
commit
0f3fd89f7d
|
@ -35,6 +35,9 @@ class Test_Files_Sharing_Api extends TestCase {
|
|||
function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
\OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups', 'no');
|
||||
\OC::$server->getAppConfig()->setValue('core', 'shareapi_expire_after_n_days', '7');
|
||||
|
||||
$this->folder = self::TEST_FOLDER_NAME;
|
||||
$this->subfolder = '/subfolder_share_api_test';
|
||||
$this->subsubfolder = '/subsubfolder_share_api_test';
|
||||
|
|
|
@ -226,6 +226,10 @@ class Test_Files_Sharing_Mount extends OCA\Files_sharing\Tests\TestCase {
|
|||
}
|
||||
|
||||
class DummyTestClassSharedMount extends \OCA\Files_Sharing\SharedMount {
|
||||
public function __construct($storage, $mountpoint, $arguments = null, $loader = null){
|
||||
// noop
|
||||
}
|
||||
|
||||
public function stripUserFilesPathDummy($path) {
|
||||
return $this->stripUserFilesPath($path);
|
||||
}
|
||||
|
|
|
@ -72,8 +72,14 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
|
|||
$backend->createUser(self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER3);
|
||||
|
||||
// create group
|
||||
\OC_Group::createGroup(self::TEST_FILES_SHARING_API_GROUP1);
|
||||
\OC_Group::addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1);
|
||||
$groupBackend = new \OC_Group_Dummy();
|
||||
$groupBackend->createGroup(self::TEST_FILES_SHARING_API_GROUP1);
|
||||
$groupBackend->createGroup('group');
|
||||
$groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER1, 'group');
|
||||
$groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, 'group');
|
||||
$groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER3, 'group');
|
||||
$groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1);
|
||||
\OC_Group::useBackend($groupBackend);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue