Table of Contents
tests/api/unit/TranslationsApiControllerTest.php
Source: tests/api/unit/TranslationsApiControllerTest.php · 270 lines, ~1154 statements · namespace: (global) · `declare(strict_types=1)`: no
TranslationsApiController Test
Unit tests for Scriptlog\Controller\Api\TranslationsApiController 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/export are public (requiresAuth=false at construction); store/update/destroy/import/cache require an administrator.
Note: the controller routes by language code ('code') and translation key ('key') for reads, and by translation ID for update()/destroy(). update() and destroy() return 200 on success (the plan's 204 is not what the implementation returns). import() reads from php://input, which is empty in the CLI runner, so only its 400 no-body branch is asserted here.
Includes
| Mode | Target | Line |
|---|---|---|
require | require_once DIR . '/../ApiTestCase.php'; | 22 |
require | require_once DIR . '/../fixtures/ApiDataFixture.php'; | 23 |
