Add WebDavTest (theoretically ..)

This commit is contained in:
Philipp Holzer 2021-09-07 20:38:57 +02:00
parent 15d77952ac
commit 749ba4315e
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432

View file

@ -2,9 +2,13 @@
namespace Friendica\Addon\webdav_storage\tests; namespace Friendica\Addon\webdav_storage\tests;
use Friendica\Test\MockedTest; use Friendica\Addon\webdav_storage\src\WebDav;
use Friendica\Core\Config\IConfig;
use Friendica\DI;
use Friendica\Model\Storage\IWritableStorage;
use Friendica\Test\src\Model\Storage\StorageTest;
class WebDavTest extends MockedTest class WebDavTest extends StorageTest
{ {
public function dataMultiStatus() public function dataMultiStatus()
{ {
@ -95,4 +99,20 @@ EOF,
self::assertCount($assertionCount, $xpath->query('//d:multistatus/d:response')); self::assertCount($assertionCount, $xpath->query('//d:multistatus/d:response'));
} }
protected function getInstance()
{
$config = \Mockery::mock(IConfig::class);
$config->shouldReceive('get')->with('webdav', 'username')->andReturn(getenv('WEBDAV_USERNAME'));
$config->shouldReceive('get')->with('webdav', 'password', '')->andReturn(getenv('WEBDAV_PASSWORD'));
$config->shouldReceive('get')->with('webdav', 'url')->andReturn(getenv('WEBDAV_URL'));
$config->shouldReceive('get')->with('webdav', 'auth_type', 'basic')->andReturn('basic');
return new WebDav(DI::l10n(), $config, DI::httpClient(), DI::logger());
}
protected function assertOption(IWritableStorage $storage)
{
self::assertCount(1, ['1']);
}
} }