Commit 0f3fd89f authored by Robin Appelman's avatar Robin Appelman
Browse files

Fix sharing tests

parent c21d1da0
......@@ -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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment