04_progress.php 849 B

12345678910111213141516171819202122
  1. <?php
  2. use \WikipaliApi\Api\ProgressApi;
  3. test('GET /v3/progress?channels=… → 200', function () {
  4. $res = request(fn () => api(ProgressApi::class)->getApiV3ProgressWithHttpInfo(fixtures()['channel']));
  5. assert_status(200, $res, 'progress');
  6. assert_has_key('data', $res['body'], 'progress');
  7. assert_has_key('meta', $res['body'], 'progress');
  8. });
  9. test('GET /v3/progress(缺 channels)→ 422', function () {
  10. $res = raw('GET', '/v3/progress');
  11. assert_status(422, $res, 'progress 缺 channels');
  12. assert_problem($res, 'progress 缺 channels');
  13. });
  14. test('GET /v3/progress?order=非法值 → 422', function () {
  15. $res = raw('GET', '/v3/progress', ['channels' => fixtures()['channel'], 'order' => 'bogus']);
  16. assert_status(422, $res, 'progress 非法 order');
  17. assert_problem($res, 'progress 非法 order');
  18. });