From: Philipp Date: Tue, 7 Sep 2021 18:38:57 +0000 (+0200) Subject: Add WebDavTest (theoretically ..) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=749ba4315ee0ae9638e299bfba9233a8e0a3c506;p=friendica-addons.git Add WebDavTest (theoretically ..) --- diff --git a/webdav_storage/tests/WebDavTest.php b/webdav_storage/tests/WebDavTest.php index b9deb255..cf4e69d2 100644 --- a/webdav_storage/tests/WebDavTest.php +++ b/webdav_storage/tests/WebDavTest.php @@ -2,9 +2,13 @@ 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() { @@ -95,4 +99,20 @@ EOF, 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']); + } }