This is an old revision of the document!
Table of Contents
tests/api/unit/ApiRateLimitHeadersTest.php
Source: tests/api/unit/ApiRateLimitHeadersTest.php · 177 lines, ~744 statements · namespace: (global) · `declare(strict_types=1)`: no
ApiRateLimitHeadersTest
Regression tests (F2) locking in the rate-limit header fix.
Rate limiting is applied in api/index.php before dispatch: GET requests consume the “read” namespace, write methods the “write” namespace. The result is stored in $GLOBALS['_api_rate_result'] and ApiResponse::send() emits X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset (plus Retry-After when the window is exhausted).
Note: RateLimiter::check() does NOT include a 'namespace' key in its result — the namespace only prefixes the on-disk counter key — so the namespace tests verify counter separation rather than a literal result field.
Includes
^ Mode ^ Target ^ Line ^ | ''require'' | ''require_once __DIR__ . '/../ApiTestCase.php';'' | 21 | | ''require'' | ''require_once __DIR__ . '/../fixtures/ApiDataFixture.php';'' | 22 |
