Skip to content

Commit 86dfdc3

Browse files
committed
test: Add capabilities tests
Signed-off-by: provokateurin <[email protected]>
1 parent 3378afd commit 86dfdc3

File tree

7 files changed

+237
-0
lines changed

7 files changed

+237
-0
lines changed

tests/lib/Capabilities.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
7+
* SPDX-License-Identifier: AGPL-3.0-or-later
8+
*/
9+
10+
namespace OCA\Notifications;
11+
12+
use OCP\Capabilities\ICapability;
13+
14+
class Capabilities implements ICapability {
15+
/**
16+
* @return array{test: array{a: int}}
17+
*/
18+
public function getCapabilities(): array {
19+
return [];
20+
}
21+
}

tests/lib/PublicCapabilities.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
7+
* SPDX-License-Identifier: AGPL-3.0-or-later
8+
*/
9+
10+
namespace OCA\Notifications;
11+
12+
use OCP\Capabilities\IPublicCapability;
13+
14+
class PublicCapabilities implements IPublicCapability {
15+
/**
16+
* @return array{test: array{b: string}}
17+
*/
18+
public function getCapabilities(): array {
19+
return [];
20+
}
21+
}

tests/openapi-administration.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@
2020
}
2121
},
2222
"schemas": {
23+
"Capabilities": {
24+
"type": "object",
25+
"required": [
26+
"test"
27+
],
28+
"properties": {
29+
"test": {
30+
"type": "object",
31+
"required": [
32+
"a"
33+
],
34+
"properties": {
35+
"a": {
36+
"type": "integer",
37+
"format": "int64"
38+
}
39+
}
40+
}
41+
}
42+
},
2343
"OCSMeta": {
2444
"type": "object",
2545
"required": [
@@ -44,6 +64,25 @@
4464
}
4565
}
4666
},
67+
"PublicCapabilities": {
68+
"type": "object",
69+
"required": [
70+
"test"
71+
],
72+
"properties": {
73+
"test": {
74+
"type": "object",
75+
"required": [
76+
"b"
77+
],
78+
"properties": {
79+
"b": {
80+
"type": "string"
81+
}
82+
}
83+
}
84+
}
85+
},
4786
"PushDevice": {
4887
"allOf": [
4988
{

tests/openapi-ex_app.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@
2020
}
2121
},
2222
"schemas": {
23+
"Capabilities": {
24+
"type": "object",
25+
"required": [
26+
"test"
27+
],
28+
"properties": {
29+
"test": {
30+
"type": "object",
31+
"required": [
32+
"a"
33+
],
34+
"properties": {
35+
"a": {
36+
"type": "integer",
37+
"format": "int64"
38+
}
39+
}
40+
}
41+
}
42+
},
2343
"OCSMeta": {
2444
"type": "object",
2545
"required": [
@@ -43,6 +63,25 @@
4363
"type": "string"
4464
}
4565
}
66+
},
67+
"PublicCapabilities": {
68+
"type": "object",
69+
"required": [
70+
"test"
71+
],
72+
"properties": {
73+
"test": {
74+
"type": "object",
75+
"required": [
76+
"b"
77+
],
78+
"properties": {
79+
"b": {
80+
"type": "string"
81+
}
82+
}
83+
}
84+
}
4685
}
4786
}
4887
},

tests/openapi-federation.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@
2020
}
2121
},
2222
"schemas": {
23+
"Capabilities": {
24+
"type": "object",
25+
"required": [
26+
"test"
27+
],
28+
"properties": {
29+
"test": {
30+
"type": "object",
31+
"required": [
32+
"a"
33+
],
34+
"properties": {
35+
"a": {
36+
"type": "integer",
37+
"format": "int64"
38+
}
39+
}
40+
}
41+
}
42+
},
2343
"OCSMeta": {
2444
"type": "object",
2545
"required": [
@@ -43,6 +63,25 @@
4363
"type": "string"
4464
}
4565
}
66+
},
67+
"PublicCapabilities": {
68+
"type": "object",
69+
"required": [
70+
"test"
71+
],
72+
"properties": {
73+
"test": {
74+
"type": "object",
75+
"required": [
76+
"b"
77+
],
78+
"properties": {
79+
"b": {
80+
"type": "string"
81+
}
82+
}
83+
}
84+
}
4685
}
4786
}
4887
},

tests/openapi-full.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@
2020
}
2121
},
2222
"schemas": {
23+
"Capabilities": {
24+
"type": "object",
25+
"required": [
26+
"test"
27+
],
28+
"properties": {
29+
"test": {
30+
"type": "object",
31+
"required": [
32+
"a"
33+
],
34+
"properties": {
35+
"a": {
36+
"type": "integer",
37+
"format": "int64"
38+
}
39+
}
40+
}
41+
}
42+
},
2343
"Collection": {
2444
"type": "array",
2545
"items": {
@@ -179,6 +199,25 @@
179199
}
180200
}
181201
},
202+
"PublicCapabilities": {
203+
"type": "object",
204+
"required": [
205+
"test"
206+
],
207+
"properties": {
208+
"test": {
209+
"type": "object",
210+
"required": [
211+
"b"
212+
],
213+
"properties": {
214+
"b": {
215+
"type": "string"
216+
}
217+
}
218+
}
219+
}
220+
},
182221
"PushDevice": {
183222
"allOf": [
184223
{

tests/openapi.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@
2020
}
2121
},
2222
"schemas": {
23+
"Capabilities": {
24+
"type": "object",
25+
"required": [
26+
"test"
27+
],
28+
"properties": {
29+
"test": {
30+
"type": "object",
31+
"required": [
32+
"a"
33+
],
34+
"properties": {
35+
"a": {
36+
"type": "integer",
37+
"format": "int64"
38+
}
39+
}
40+
}
41+
}
42+
},
2343
"Collection": {
2444
"type": "array",
2545
"items": {
@@ -179,6 +199,25 @@
179199
}
180200
}
181201
},
202+
"PublicCapabilities": {
203+
"type": "object",
204+
"required": [
205+
"test"
206+
],
207+
"properties": {
208+
"test": {
209+
"type": "object",
210+
"required": [
211+
"b"
212+
],
213+
"properties": {
214+
"b": {
215+
"type": "string"
216+
}
217+
}
218+
}
219+
}
220+
},
182221
"RequestProperty": {
183222
"type": "object",
184223
"required": [

0 commit comments

Comments
 (0)