fix factory test
This commit is contained in:
parent
e1f2a6df94
commit
169031d1c5
|
@ -8,7 +8,6 @@
|
|||
|
||||
namespace OC\Files\Storage;
|
||||
|
||||
use OCP\Files\Config\IMountProviderCollection;
|
||||
use OCP\Files\Mount\IMountPoint;
|
||||
use OCP\Files\Storage\IStorageFactory;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Test\Files\Storage;
|
|||
|
||||
use OC\Files\Mount\MountPoint;
|
||||
use OCP\Files\Mount\IMountPoint;
|
||||
use OCP\Files\Storage;
|
||||
use OCP\Files\Storage as IStorage;
|
||||
use Test\TestCase;
|
||||
use OC\Files\Storage\Wrapper\Wrapper;
|
||||
|
||||
|
@ -22,7 +22,7 @@ class StorageFactory extends TestCase {
|
|||
public function testSimpleWrapper() {
|
||||
$instance = new \OC\Files\Storage\StorageFactory();
|
||||
$mount = new MountPoint('\OC\Files\Storage\Temporary', '/foo', [[]], $instance);
|
||||
$instance->addStorageWrapper('dummy', function ($mountPoint, Storage $storage, IMountPoint $mount) {
|
||||
$instance->addStorageWrapper('dummy', function ($mountPoint, IStorage $storage, IMountPoint $mount) {
|
||||
$this->assertInstanceOf('\OC\Files\Storage\Temporary', $storage);
|
||||
$this->assertEquals('/foo/', $mount->getMountPoint());
|
||||
$this->assertEquals('/foo/', $mountPoint);
|
||||
|
@ -35,7 +35,7 @@ class StorageFactory extends TestCase {
|
|||
public function testRemoveWrapper() {
|
||||
$instance = new \OC\Files\Storage\StorageFactory();
|
||||
$mount = new MountPoint('\OC\Files\Storage\Temporary', '/foo', [[]], $instance);
|
||||
$instance->addStorageWrapper('dummy', function ($mountPoint, Storage $storage) {
|
||||
$instance->addStorageWrapper('dummy', function ($mountPoint, IStorage $storage) {
|
||||
return new DummyWrapper(['storage' => $storage]);
|
||||
});
|
||||
$instance->removeStorageWrapper('dummy');
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
namespace Test\Files;
|
||||
|
||||
use OC\Files\Cache\Watcher;
|
||||
use OC\Files\Filesystem;
|
||||
use OC\Files\Mount\MountPoint;
|
||||
use OC\Files\Storage\Temporary;
|
||||
|
||||
|
@ -980,7 +979,7 @@ class View extends \Test\TestCase {
|
|||
|
||||
public function testSetMountOptionsInStorage() {
|
||||
$mount = new MountPoint('\OC\Files\Storage\Temporary', '/asd/', [[]], Filesystem::getLoader(), ['foo' => 'bar']);
|
||||
Filesystem::getMountManager()->addMount($mount);
|
||||
\OC\Files\Filesystem::getMountManager()->addMount($mount);
|
||||
/** @var \OC\Files\Storage\Common $storage */
|
||||
$storage = $mount->getStorage();
|
||||
$this->assertEquals($storage->getMountOption('foo'), 'bar');
|
||||
|
@ -988,7 +987,7 @@ class View extends \Test\TestCase {
|
|||
|
||||
public function testSetMountOptionsWatcherPolicy() {
|
||||
$mount = new MountPoint('\OC\Files\Storage\Temporary', '/asd/', [[]], Filesystem::getLoader(), ['filesystem_check_changes' => Watcher::CHECK_NEVER]);
|
||||
Filesystem::getMountManager()->addMount($mount);
|
||||
\OC\Files\Filesystem::getMountManager()->addMount($mount);
|
||||
/** @var \OC\Files\Storage\Common $storage */
|
||||
$storage = $mount->getStorage();
|
||||
$watcher = $storage->getWatcher();
|
||||
|
|
Loading…
Reference in New Issue