Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:tests:commentsapicontrollertest

This is an old revision of the document!


tests/api/unit/CommentsApiControllerTest.php

Source: tests/api/unit/CommentsApiControllerTest.php · 292 lines, ~1308 statements · namespace: (global) · `declare(strict_types=1)`: no


CommentsApiController Test

Unit tests for Scriptlog\Controller\Api\CommentsApiController driven through the subprocess runner (ApiTestCase::runController). Controller actions terminate the process via ApiResponse::send(), so each action runs in an isolated PHP process against the seeded test database.

Auth: index/show/store are public (requiresAuth=false at construction). show() additionally restricts non-approved comments to authenticated callers. update()/destroy() re-enable requiresAuth and enforce administrator/editor permission.

Includes

^ Mode ^ Target ^ Line ^
| ''require'' | ''require_once __DIR__ . '/../ApiTestCase.php';'' | 18 |
| ''require'' | ''require_once __DIR__ . '/../fixtures/ApiDataFixture.php';'' | 19 |

Types declared here


Generated by 'tools/gendoc'.

scriptlog/tests/commentsapicontrollertest.1790413764.txt.gz · Last modified: by admin