scriptlog:tests:apiauthtest
Table of Contents
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
scriptlog/tests/apiauthtest.txt · Last modified: by admin
