Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:tests:translationsapicontrollertest

This is an old revision of the document!


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 |

Types declared here


Generated by 'tools/gendoc'.

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