Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:tests:apiauthtest

This is an old revision of the document!


tests/unit/ApiAuthTest.php

Source: tests/unit/ApiAuthTest.php · 141 lines, ~776 statements · namespace: (global) · `declare(strict_types=1)`: no


ApiAuth Unit Tests

Tests for API authentication methods that do NOT require a database: \- Header parsing (getApiKey, getBearerToken) \- State queries (isAuthenticated, getUser, getUserId, getUserLevel, getAuthType) \- Permission checks (hasPermission) \- CSRF token generation \- Client IP detection

Database-dependent methods (authenticateWithApiKey, authenticateWithToken, generateApiKey, revokeApiKey, logAccess) are covered by integration tests.

Imports

^ Alias ^ Fully-qualified name ^
| ''ApiAuth'' | ''Scriptlog\Core\ApiAuth'' |

Types declared here


Generated by 'tools/gendoc'.

scriptlog/tests/apiauthtest.1790413765.txt.gz · Last modified: by admin