use Friendica\Core\Config\Factory\Config;
use Friendica\Core\Config\Repository;
use Friendica\Core\Storage\Type;
-use Friendica\Network\HTTPClient\Client\HttpClient;
use Friendica\Test\DatabaseTest;
use Friendica\Test\Util\Database\StaticDatabase;
use Friendica\Test\Util\VFSTrait;
private $logger;
/** @var L10n */
private $l10n;
- /** @var HttpClient */
- private $httpRequest;
protected function setUp(): void
{
$this->config->set('storage', 'filesystem_path', $this->root->getChild(Type\FilesystemConfig::DEFAULT_BASE_FOLDER)->url());
$this->l10n = \Mockery::mock(L10n::class);
-
- $this->httpRequest = \Mockery::mock(HttpClient::class);
}
protected function tearDown(): void
*/
public function testInstance()
{
- $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n, $this->httpRequest);
+ $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n, false);
self::assertInstanceOf(StorageManager::class, $storageManager);
}
$this->config->set('storage', 'name', $name);
}
- $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n);
+ $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n, false);
if ($interface === ICanWriteToStorage::class) {
$storage = $storageManager->getWritableStorageByName($name);
*/
public function testIsValidBackend($name, $valid, $interface, $assert, $assertName)
{
- $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n);
+ $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n, false);
// true in every of the backends
self::assertEquals(!empty($assertName), $storageManager->isValidBackend($name));
*/
public function testListBackends()
{
- $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n);
+ $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n, false);
self::assertEquals(StorageManager::DEFAULT_BACKENDS, $storageManager->listBackends());
}
static::markTestSkipped('only works for ICanWriteToStorage');
}
- $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n);
+ $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n, false);
$selBackend = $storageManager->getWritableStorageByName($name);
$storageManager->setBackend($selBackend);
$this->expectException(InvalidClassStorageException::class);
}
- $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n);
+ $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n, false);
self::assertInstanceOf($assert, $storageManager->getBackend());
}
->addRule(IHandleSessions::class, ['instanceOf' => Memory::class, 'shared' => true, 'call' => null]);
DI::init($dice);
- $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n);
+ $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n, false);
self::assertTrue($storageManager->register(SampleStorageBackend::class));
->addRule(IHandleSessions::class, ['instanceOf' => Memory::class, 'shared' => true, 'call' => null]);
DI::init($dice);
- $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n);
+ $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n, false);
self::assertTrue($storageManager->register(SampleStorageBackend::class));
$this->loadFixture(__DIR__ . '/../../../../datasets/storage/database.fixture.php', $this->dba);
- $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n);
+ $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n, false);
$storage = $storageManager->getWritableStorageByName($name);
$storageManager->move($storage);
$this->expectException(InvalidClassStorageException::class);
$this->expectExceptionMessage('Backend SystemResource is not valid');
- $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n);
+ $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n, false);
$storage = $storageManager->getWritableStorageByName(SystemResource::getName());
$storageManager->move($storage);
}