mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-22 05:43:41 +00:00
Add WebDavTest (theoretically ..)
This commit is contained in:
parent
15d77952ac
commit
749ba4315e
1 changed files with 22 additions and 2 deletions
|
@ -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']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue