use Psr\Log\NullLogger;
use Friendica\Test\Util\SampleStorageBackend;
-/**
- * @todo Rework Hook:: methods to dynamic to remove the separated process annotation
- *
- * @runTestsInSeparateProcesses
- */
class StorageManagerTest extends DatabaseTest
{
/** @var Database */
{
$storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n);
- $this->assertEquals($userBackend, $storageManager->isValidBackend($name));
+ // true in every of the backends
+ $this->assertEquals(!empty($assertName), $storageManager->isValidBackend($name));
+
+ // if userBackend is set to true, filter out e.g. SystemRessource
+ $this->assertEquals($userBackend, $storageManager->isValidBackend($name, true));
}
/**
$this->assertNotEmpty($data);
}
}
+
+ /**
+ * Test moving data to a WRONG storage
+ *
+ * @expectedException \Friendica\Model\Storage\StorageException
+ * @expectedExceptionMessageRegExp /Can't move to storage backend '.*'/
+ */
+ public function testMoveStorageWrong()
+ {
+ $storageManager = new StorageManager($this->dba, $this->config, $this->logger, $this->l10n);
+ $storage = $storageManager->getByName(Storage\SystemResource::getName());
+ $storageManager->move($storage);
+ }
}