From d834f77b7eeef08b4cf2d7eb37dd286b7f7f0505 Mon Sep 17 00:00:00 2001 From: Abel Hoogeveen Date: Mon, 21 Dec 2020 14:38:03 +0100 Subject: [PATCH] Integration Tests for all Providers (#1) Fixed FileProvider returning an illegal index. Now working with docker secrets. Started implementing drone Reviewed-on: https://gitea.i15.nl/FuzeWorks/ObjectStorage/pulls/1 Co-Authored-By: Abel Hoogeveen Co-Committed-By: Abel Hoogeveen --- .drone.yml | 41 +++++++++++++++++++ .../ObjectStorage/Provider/FileProvider.php | 6 ++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..7bb2952 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,41 @@ +kind: pipeline +type: docker +name: test + +services: + - name: cache + image: redis + +steps: + - name: composer + image: composer:latest + commands: + - composer install + + - name: dummyprovidertest + image: registry.i15.nl/i15/fuzephp:7.4-alpine + commands: + - docker-php-ext-enable xdebug + - vendor/bin/phpunit -c test/phpunit.xml + environment: + OBJECTSTORAGE_PROVIDER: DummyProvider + + - name: fileprovidertest + image: registry.i15.nl/i15/fuzephp:7.4-alpine + commands: + - docker-php-ext-enable xdebug + - vendor/bin/phpunit -c test/phpunit.xml + environment: + OBJECTSTORAGE_PROVIDER: FileProvider + + - name: redisprovidertest + image: registry.i15.nl/i15/fuzephp:7.4-alpine + commands: + - docker-php-ext-enable xdebug + - vendor/bin/phpunit -c test/phpunit.xml + environment: + OBJECTSTORAGE_PROVIDER: RedisProvider + OBJECTSTORAGE_REDIS_HOST: cache + +image_pull_secrets: + - dockerconfig \ No newline at end of file diff --git a/src/FuzeWorks/ObjectStorage/Provider/FileProvider.php b/src/FuzeWorks/ObjectStorage/Provider/FileProvider.php index 5d76ef2..f0d4b06 100644 --- a/src/FuzeWorks/ObjectStorage/Provider/FileProvider.php +++ b/src/FuzeWorks/ObjectStorage/Provider/FileProvider.php @@ -114,7 +114,11 @@ class FileProvider implements iObjectStorageProvider public function getIndex(): array { - return $this->index; + $out = []; + foreach ($this->index as $key => $val) + $out[] = $key; + + return $out; } public function getItem(string $key)