summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-05-16 19:05:14 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-05-16 17:45:00 +0000
commitb424937a6c4a78a766f815596b2360dca7c1281a (patch)
tree1c3c2b57b92d75a8ebbec4f4ddd619db3be3abb7
parent5d6189f5833e4d54c5e3c3c6ca2ac67ad4ad2c9b (diff)
fix: Fix Psalm, OpenAPI and unit testsbackport/12283/stable29
Signed-off-by: Joas Schilling <coding@schilljs.com> [skip ci]
-rw-r--r--lib/Controller/CallController.php2
-rw-r--r--openapi-full.json20
-rw-r--r--openapi.json20
-rw-r--r--src/types/openapi/openapi-full.ts4
-rw-r--r--src/types/openapi/openapi.ts4
-rw-r--r--tests/php/Service/ParticipantServiceTest.php5
6 files changed, 41 insertions, 14 deletions
diff --git a/lib/Controller/CallController.php b/lib/Controller/CallController.php
index 2a95c0c39..378432d04 100644
--- a/lib/Controller/CallController.php
+++ b/lib/Controller/CallController.php
@@ -182,7 +182,7 @@ class CallController extends AEnvironmentAwareController {
* Ring an attendee
*
* @param int $attendeeId ID of the attendee to ring
- * @return DataResponse<Http::STATUS_OK|Http::STATUS_BAD_REQUEST|Http::STATUS_NOT_FOUND, array<empty>, array{}>
+ * @return DataResponse<Http::STATUS_OK|Http::STATUS_NOT_FOUND, array<empty>, array{}>|DataResponse<Http::STATUS_BAD_REQUEST, array{error: string}, array{}>
*
* 200: Attendee rang successfully
* 400: Ringing attendee is not possible
diff --git a/openapi-full.json b/openapi-full.json
index 8489fc96b..168686590 100644
--- a/openapi-full.json
+++ b/openapi-full.json
@@ -4062,8 +4062,8 @@
}
}
},
- "400": {
- "description": "Ringing attendee is not possible",
+ "404": {
+ "description": "Attendee could not be found",
"content": {
"application/json": {
"schema": {
@@ -4090,8 +4090,8 @@
}
}
},
- "404": {
- "description": "Attendee could not be found",
+ "400": {
+ "description": "Ringing attendee is not possible",
"content": {
"application/json": {
"schema": {
@@ -4110,7 +4110,17 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "error"
+ ],
+ "properties": {
+ "error": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
diff --git a/openapi.json b/openapi.json
index 661cd6e98..dac1df803 100644
--- a/openapi.json
+++ b/openapi.json
@@ -3949,8 +3949,8 @@
}
}
},
- "400": {
- "description": "Ringing attendee is not possible",
+ "404": {
+ "description": "Attendee could not be found",
"content": {
"application/json": {
"schema": {
@@ -3977,8 +3977,8 @@
}
}
},
- "404": {
- "description": "Attendee could not be found",
+ "400": {
+ "description": "Ringing attendee is not possible",
"content": {
"application/json": {
"schema": {
@@ -3997,7 +3997,17 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "error"
+ ],
+ "properties": {
+ "error": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts
index 69bb82418..967978eed 100644
--- a/src/types/openapi/openapi-full.ts
+++ b/src/types/openapi/openapi-full.ts
@@ -1800,7 +1800,9 @@ export type operations = {
"application/json": {
ocs: {
meta: components["schemas"]["OCSMeta"];
- data: unknown;
+ data: {
+ error: string;
+ };
};
};
};
diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts
index 5ba97b49d..c60a91ac1 100644
--- a/src/types/openapi/openapi.ts
+++ b/src/types/openapi/openapi.ts
@@ -1623,7 +1623,9 @@ export type operations = {
"application/json": {
ocs: {
meta: components["schemas"]["OCSMeta"];
- data: unknown;
+ data: {
+ error: string;
+ };
};
};
};
diff --git a/tests/php/Service/ParticipantServiceTest.php b/tests/php/Service/ParticipantServiceTest.php
index aa99a35d6..7b9303262 100644
--- a/tests/php/Service/ParticipantServiceTest.php
+++ b/tests/php/Service/ParticipantServiceTest.php
@@ -43,6 +43,7 @@ use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IUserManager;
use OCP\Security\ISecureRandom;
+use OCP\UserStatus\IManager;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
@@ -95,6 +96,7 @@ class ParticipantServiceTest extends TestCase {
$this->federationBackendNotifier = $this->createMock(BackendNotifier::class);
$this->time = $this->createMock(ITimeFactory::class);
$this->cacheFactory = $this->createMock(ICacheFactory::class);
+ $this->userStatusManager = $this->createMock(IManager::class);
$this->service = new ParticipantService(
$this->serverConfig,
$this->talkConfig,
@@ -110,7 +112,8 @@ class ParticipantServiceTest extends TestCase {
$this->membershipService,
$this->federationBackendNotifier,
$this->time,
- $this->cacheFactory
+ $this->cacheFactory,
+ $this->userStatusManager,
);
}