Fix sharing tests

This commit is contained in:
Robin Appelman 2014-11-06 18:31:33 +01:00
parent c21d1da01a
commit 0f3fd89f7d
3 changed files with 15 additions and 2 deletions

View File

@ -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';

View File

@ -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);
}

View File

@ -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);
}