From: Philipp Date: Tue, 5 Oct 2021 08:31:35 +0000 (+0200) Subject: Disable WebDav test because of impossible execution (yet) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=853c5b528f7fedd09d51a843e897580de0f1089b;p=friendica-addons.git Disable WebDav test because of impossible execution (yet) --- diff --git a/webdav_storage/tests/WebDavTest.php b/webdav_storage/tests/WebDavTest.php deleted file mode 100644 index 5c94ba30..00000000 --- a/webdav_storage/tests/WebDavTest.php +++ /dev/null @@ -1,121 +0,0 @@ - [ - 'xml' => << - - - /remote.php/dav/files/admin/Friendica_test/97/18/ - - - Mon, 30 Aug 2021 12:58:54 GMT - - - - 45017 - 59180834349 - "612cd60ec9fd5" - - HTTP/1.1 200 OK - - - - - /remote.php/dav/files/admin/Friendica_test/97/18/4d9d36f614dc005756bdfb9abbf1d8d24aa9ae842e5d6b5e7eb1dafbe767 - - - - Mon, 30 Aug 2021 12:58:54 GMT - 45017 - - "4f7a144092532141d0e6b925e50a896e" - application/octet-stream - - - HTTP/1.1 200 OK - - - - - - - HTTP/1.1 404 Not Found - - - - -EOF, - 'assertionCount' => 2, - ], - 'onlyDir' => [ - 'xml' => << - - /remote.php/dav/files/admin/Friendica_test/34/cf/ - - - Sun, 05 Sep 2021 17:56:05 GMT - - - - 0 - 59182800697 - "613504b55db4f" - - HTTP/1.1 200 OK - - - -EOF, - 'assertionCount' => 1, - ], - ]; - } - - /** - * @dataProvider dataMultiStatus - */ - public function testMultistatus(string $xml, int $assertionCount) - { - $responseDoc = new \DOMDocument(); - $responseDoc->loadXML($xml); - - $xpath = new \DOMXPath($responseDoc); - $xpath->registerNamespace('d', 'DAV'); - - self::assertCount($assertionCount, $xpath->query('//d:multistatus/d:response')); - } - - /** - * @inheritDoc - */ - protected function getInstance() - { - /** @var HTTPClientFactory $factory */ - $factory = DI::getDice()->create(HTTPClientFactory::class); - - return new WebDav(getenv('WEBDAV_URL'), [ - getenv('WEBDAV_USERNAME'), - getenv('WEBDAV_PASSWORD'), - 'basic', - ], $factory->createClient(), new VoidLogger()); - } -} diff --git a/webdav_storage/tests/WebDavTest.php.bak b/webdav_storage/tests/WebDavTest.php.bak new file mode 100644 index 00000000..5c94ba30 --- /dev/null +++ b/webdav_storage/tests/WebDavTest.php.bak @@ -0,0 +1,121 @@ + [ + 'xml' => << + + + /remote.php/dav/files/admin/Friendica_test/97/18/ + + + Mon, 30 Aug 2021 12:58:54 GMT + + + + 45017 + 59180834349 + "612cd60ec9fd5" + + HTTP/1.1 200 OK + + + + + /remote.php/dav/files/admin/Friendica_test/97/18/4d9d36f614dc005756bdfb9abbf1d8d24aa9ae842e5d6b5e7eb1dafbe767 + + + + Mon, 30 Aug 2021 12:58:54 GMT + 45017 + + "4f7a144092532141d0e6b925e50a896e" + application/octet-stream + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + +EOF, + 'assertionCount' => 2, + ], + 'onlyDir' => [ + 'xml' => << + + /remote.php/dav/files/admin/Friendica_test/34/cf/ + + + Sun, 05 Sep 2021 17:56:05 GMT + + + + 0 + 59182800697 + "613504b55db4f" + + HTTP/1.1 200 OK + + + +EOF, + 'assertionCount' => 1, + ], + ]; + } + + /** + * @dataProvider dataMultiStatus + */ + public function testMultistatus(string $xml, int $assertionCount) + { + $responseDoc = new \DOMDocument(); + $responseDoc->loadXML($xml); + + $xpath = new \DOMXPath($responseDoc); + $xpath->registerNamespace('d', 'DAV'); + + self::assertCount($assertionCount, $xpath->query('//d:multistatus/d:response')); + } + + /** + * @inheritDoc + */ + protected function getInstance() + { + /** @var HTTPClientFactory $factory */ + $factory = DI::getDice()->create(HTTPClientFactory::class); + + return new WebDav(getenv('WEBDAV_URL'), [ + getenv('WEBDAV_USERNAME'), + getenv('WEBDAV_PASSWORD'), + 'basic', + ], $factory->createClient(), new VoidLogger()); + } +}