Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:tests:apisearchcontrollertest

tests/api/unit/ApiSearchControllerTest.php

Source: tests/api/unit/ApiSearchControllerTest.php · 186 lines, ~859 statements · namespace: (global) · `declare(strict_types=1)`: no


SearchApiController Test (named ApiSearchControllerTest)

Unit tests for Scriptlog\Controller\Api\SearchApiController 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: the endpoint is public (requiresAuth=false at construction). Input is read from the $_GET superglobal, so query parameters are passed via the runner's “get” option rather than the action params.

Naming note: the class is ApiSearchControllerTest (not SearchApiControllerTest) because tests/unit/SearchApiControllerTest.php already declares a global SearchApiControllerTest class; the recursive “Scriptlog Test Suite” in phpunit.xml would otherwise load two classes with the same name and fatal.

Includes

Mode Target Line
require require_once DIR . '/../ApiTestCase.php'; 23
require require_once DIR . '/../fixtures/ApiDataFixture.php'; 24

Types declared here


Generated by 'tools/gendoc'.

scriptlog/tests/apisearchcontrollertest.txt · Last modified: by admin