adjust filesystem tests to objectstore

This commit is contained in:
Jörn Friedrich Dreyer 2015-10-01 13:23:30 +02:00 committed by Morris Jobke
parent 020bb33150
commit c8640cdcb0

View file

@ -325,8 +325,14 @@ class Filesystem extends \Test\TestCase {
$homeMount = \OC\Files\Filesystem::getStorage('/' . $userId . '/');
$this->assertTrue($homeMount->instanceOfStorage('\OC\Files\Storage\Home'));
$this->assertEquals('home::' . $userId, $homeMount->getId());
$this->assertTrue($homeMount->instanceOfStorage('\OCP\Files\IHomeStorage'));
if (getenv('RUN_OBJECTSTORE_TESTS')) {
$this->assertTrue($homeMount->instanceOfStorage('\OC\Files\ObjectStore\HomeObjectStoreStorage'));
$this->assertEquals('object::user:' . $userId, $homeMount->getId());
} else {
$this->assertTrue($homeMount->instanceOfStorage('\OC\Files\Storage\Home'));
$this->assertEquals('home::' . $userId, $homeMount->getId());
}
\OC_User::deleteUser($userId);
}
@ -336,6 +342,9 @@ class Filesystem extends \Test\TestCase {
* for the user's mount point
*/
public function testLegacyHomeMount() {
if (getenv('RUN_OBJECTSTORE_TESTS')) {
$this->markTestSkipped('legacy storage unrelated to objectstore environments');
}
$datadir = \OC_Config::getValue("datadirectory", \OC::$SERVERROOT . "/data");
$userId = $this->getUniqueID('user_');
@ -380,7 +389,7 @@ class Filesystem extends \Test\TestCase {
\OC\Files\Filesystem::getMountPoint('/' . $userId . '/cache')
);
list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath('/' . $userId . '/cache');
$this->assertTrue($storage->instanceOfStorage('\OC\Files\Storage\Home'));
$this->assertTrue($storage->instanceOfStorage('\OCP\Files\IHomeStorage'));
$this->assertEquals('cache', $internalPath);
\OC_User::deleteUser($userId);