From 3425cd3d478eb79dd238c139355314c94d08e89c Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 25 Feb 2022 08:48:13 +0100 Subject: [PATCH] Add feedback --- s3_storage/composer.json | 20 +++--- s3_storage/tests/S3Test.php.bak | 121 -------------------------------- 2 files changed, 10 insertions(+), 131 deletions(-) delete mode 100644 s3_storage/tests/S3Test.php.bak diff --git a/s3_storage/composer.json b/s3_storage/composer.json index 3363806d..7c5a8e78 100644 --- a/s3_storage/composer.json +++ b/s3_storage/composer.json @@ -3,21 +3,21 @@ "description": "Adds the possibility to use S3 as a selectable storage backend", "type": "friendica-addon", "authors": [ - { - "name": "Philipp Holzer", - "email": "admin@philipp.info", - "homepage": "https://blog.philipp.info", - "role": "Developer" - } + { + "name": "Philipp Holzer", + "email": "admin@philipp.info", + "homepage": "https://blog.philipp.info", + "role": "Developer" + } ], "require": { - "php": ">=7.0", + "php": ">=7.0", "akeeba/s3": "^2.0" }, "license": "3-clause BSD license", "config": { - "optimize-autoloader": true, - "autoloader-suffix": "S3StorageAddon", - "preferred-install": "dist" + "optimize-autoloader": true, + "autoloader-suffix": "S3StorageAddon", + "preferred-install": "dist" } } diff --git a/s3_storage/tests/S3Test.php.bak b/s3_storage/tests/S3Test.php.bak deleted file mode 100644 index bdcbd005..00000000 --- a/s3_storage/tests/S3Test.php.bak +++ /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()); - } -}