mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2025-01-12 02:42:41 +00:00
Fix output of NCN version list
List is supposed to be contained in a JSON object, not a bare list
This commit is contained in:
parent
536fa5c4fd
commit
25d9158171
2 changed files with 7 additions and 2 deletions
|
@ -17,7 +17,12 @@ class Versions implements \JKingWeb\NewsSync\REST\Handler {
|
||||||
return new Response(405);
|
return new Response(405);
|
||||||
}
|
}
|
||||||
if(preg_match("<^/?$>",$path)) {
|
if(preg_match("<^/?$>",$path)) {
|
||||||
return new Response(200, ['v1-2']);
|
$out = [
|
||||||
|
'apiLevels' => [
|
||||||
|
'v1-2'
|
||||||
|
]
|
||||||
|
];
|
||||||
|
return new Response(200, $out);
|
||||||
} else {
|
} else {
|
||||||
return new Response(404);
|
return new Response(404);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ class TestNCNVersionDiscovery extends \PHPUnit\Framework\TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
function testVersionList() {
|
function testVersionList() {
|
||||||
$exp = new Response(200, ['v1-2']);
|
$exp = new Response(200, ['apiLevels' => ['v1-2']]);
|
||||||
$req = new Request("GET", "/");
|
$req = new Request("GET", "/");
|
||||||
$h = new Rest\NextCloudNews\Versions($this->data);
|
$h = new Rest\NextCloudNews\Versions($this->data);
|
||||||
$res = $h->dispatch($req);
|
$res = $h->dispatch($req);
|
||||||
|
|
Loading…
Reference in a new issue