2026-07-15 10:29:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
2026-07-19 09:42:04 +00:00
|
|
|
it('documents POST for service application actions', function () {
|
2026-07-15 10:29:58 +00:00
|
|
|
$openApi = json_decode(
|
|
|
|
|
file_get_contents(__DIR__.'/../../openapi.json'),
|
|
|
|
|
true,
|
|
|
|
|
flags: JSON_THROW_ON_ERROR,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$actionPaths = [
|
|
|
|
|
'/services/{uuid}/applications/{app_uuid}/start',
|
|
|
|
|
'/services/{uuid}/applications/{app_uuid}/restart',
|
|
|
|
|
'/services/{uuid}/applications/{app_uuid}/stop',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
foreach ($actionPaths as $path) {
|
|
|
|
|
expect($openApi['paths'][$path])
|
2026-07-19 09:42:04 +00:00
|
|
|
->toHaveKey('post')
|
|
|
|
|
->not->toHaveKey('get')
|
2026-07-15 10:29:58 +00:00
|
|
|
->and($openApi['paths'][$path]['post']['responses'])
|
|
|
|
|
->toHaveKeys(['200', '400', '401', '404', '501']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
expect($openApi['paths'][$actionPaths[0]]['post']['responses']['200']['content']['application/json']['schema']['properties'])
|
2026-07-19 09:42:04 +00:00
|
|
|
->toHaveKey('message')
|
2026-07-15 10:29:58 +00:00
|
|
|
->and($openApi['paths'][$actionPaths[1]]['post']['responses']['200']['content']['application/json']['schema']['properties'])
|
|
|
|
|
->toHaveKey('message')
|
|
|
|
|
->and($openApi['paths'][$actionPaths[2]]['post']['responses']['200']['content']['application/json']['schema']['properties'])
|
|
|
|
|
->toHaveKey('message');
|
|
|
|
|
});
|