Skip to content

Commit

Permalink
test: Add capabilities tests
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Dec 17, 2024
1 parent 3378afd commit 86dfdc3
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/lib/Capabilities.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Notifications;

use OCP\Capabilities\ICapability;

class Capabilities implements ICapability {
/**
* @return array{test: array{a: int}}
*/
public function getCapabilities(): array {
return [];
}
}
21 changes: 21 additions & 0 deletions tests/lib/PublicCapabilities.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Notifications;

use OCP\Capabilities\IPublicCapability;

class PublicCapabilities implements IPublicCapability {
/**
* @return array{test: array{b: string}}
*/
public function getCapabilities(): array {
return [];
}
}
39 changes: 39 additions & 0 deletions tests/openapi-administration.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@
}
},
"schemas": {
"Capabilities": {
"type": "object",
"required": [
"test"
],
"properties": {
"test": {
"type": "object",
"required": [
"a"
],
"properties": {
"a": {
"type": "integer",
"format": "int64"
}
}
}
}
},
"OCSMeta": {
"type": "object",
"required": [
Expand All @@ -44,6 +64,25 @@
}
}
},
"PublicCapabilities": {
"type": "object",
"required": [
"test"
],
"properties": {
"test": {
"type": "object",
"required": [
"b"
],
"properties": {
"b": {
"type": "string"
}
}
}
}
},
"PushDevice": {
"allOf": [
{
Expand Down
39 changes: 39 additions & 0 deletions tests/openapi-ex_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@
}
},
"schemas": {
"Capabilities": {
"type": "object",
"required": [
"test"
],
"properties": {
"test": {
"type": "object",
"required": [
"a"
],
"properties": {
"a": {
"type": "integer",
"format": "int64"
}
}
}
}
},
"OCSMeta": {
"type": "object",
"required": [
Expand All @@ -43,6 +63,25 @@
"type": "string"
}
}
},
"PublicCapabilities": {
"type": "object",
"required": [
"test"
],
"properties": {
"test": {
"type": "object",
"required": [
"b"
],
"properties": {
"b": {
"type": "string"
}
}
}
}
}
}
},
Expand Down
39 changes: 39 additions & 0 deletions tests/openapi-federation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@
}
},
"schemas": {
"Capabilities": {
"type": "object",
"required": [
"test"
],
"properties": {
"test": {
"type": "object",
"required": [
"a"
],
"properties": {
"a": {
"type": "integer",
"format": "int64"
}
}
}
}
},
"OCSMeta": {
"type": "object",
"required": [
Expand All @@ -43,6 +63,25 @@
"type": "string"
}
}
},
"PublicCapabilities": {
"type": "object",
"required": [
"test"
],
"properties": {
"test": {
"type": "object",
"required": [
"b"
],
"properties": {
"b": {
"type": "string"
}
}
}
}
}
}
},
Expand Down
39 changes: 39 additions & 0 deletions tests/openapi-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@
}
},
"schemas": {
"Capabilities": {
"type": "object",
"required": [
"test"
],
"properties": {
"test": {
"type": "object",
"required": [
"a"
],
"properties": {
"a": {
"type": "integer",
"format": "int64"
}
}
}
}
},
"Collection": {
"type": "array",
"items": {
Expand Down Expand Up @@ -179,6 +199,25 @@
}
}
},
"PublicCapabilities": {
"type": "object",
"required": [
"test"
],
"properties": {
"test": {
"type": "object",
"required": [
"b"
],
"properties": {
"b": {
"type": "string"
}
}
}
}
},
"PushDevice": {
"allOf": [
{
Expand Down
39 changes: 39 additions & 0 deletions tests/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@
}
},
"schemas": {
"Capabilities": {
"type": "object",
"required": [
"test"
],
"properties": {
"test": {
"type": "object",
"required": [
"a"
],
"properties": {
"a": {
"type": "integer",
"format": "int64"
}
}
}
}
},
"Collection": {
"type": "array",
"items": {
Expand Down Expand Up @@ -179,6 +199,25 @@
}
}
},
"PublicCapabilities": {
"type": "object",
"required": [
"test"
],
"properties": {
"test": {
"type": "object",
"required": [
"b"
],
"properties": {
"b": {
"type": "string"
}
}
}
}
},
"RequestProperty": {
"type": "object",
"required": [
Expand Down

0 comments on commit 86dfdc3

Please sign in to comment.