From e7ba19431304ee550b6afdebd0fbd7323df91b88 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 8 Jun 2023 10:20:10 -0300 Subject: [PATCH 1/2] Check if key exists Signed-off-by: Vitor Mattos --- src/NextcloudApiContext.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NextcloudApiContext.php b/src/NextcloudApiContext.php index 5680e20..8d489ab 100644 --- a/src/NextcloudApiContext.php +++ b/src/NextcloudApiContext.php @@ -245,6 +245,11 @@ public function theResponseShouldBeAJsonArrayWithTheFollowingMandatoryValues(Tab $expectedValues = $table->getColumnsHash(); $realResponseArray = json_decode($this->response->getBody()->getContents(), true); foreach ($expectedValues as $value) { + Assert::assertArrayHasKey( + $value['key'], + $realResponseArray, + 'Not found: "' . $value['key'] . '" at array: ' . json_encode($realResponseArray) + ); if (is_bool($realResponseArray[$value['key']]) || is_iterable($realResponseArray[$value['key']]) || is_numeric($realResponseArray[$value['key']]) From 324ef77711efab3cd73e5a880bcf644ff6b9d607 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 8 Jun 2023 12:42:07 -0300 Subject: [PATCH 2/2] Fix dependencies Signed-off-by: Vitor Mattos --- composer.json | 9 ++++- psalm.xml | 2 + vendor-bin/coding-standard/composer.json | 2 +- vendor-bin/coding-standard/composer.lock | 24 +++++++----- vendor-bin/psalm/composer.lock | 47 +++++++++++++----------- 5 files changed, 51 insertions(+), 33 deletions(-) diff --git a/composer.json b/composer.json index df7d6ee..ea1ab8f 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,14 @@ "config": { "allow-plugins": { "bamarni/composer-bin-plugin": true - } + }, + "optimize-autoloader": true + }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": true + } }, "autoload": { "psr-4": { diff --git a/psalm.xml b/psalm.xml index ac444bd..01b01a1 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,6 +1,8 @@