Generated 2026-03-29 by punishing audit.
| Category | Count | Notes |
|---|---|---|
| Unit tests | 11 | HeadersTest, SanitizerTest, TurtleEscaperTest, ValidatorTest, WordPress/AdapterTest, IndieWeb/(MicropubTest, IndieAuthTest, WebmentionTest), RateLimit/(TokenBucketTest, StoreTest, RateLimiterTest) |
| Integration | 3 | validation/RealWorldTest.php, run-tests.php, test-cf7-xss.php |
| E2E | 0 | None |
| Benchmarks | 0 | None |
Source modules: 14 PHP source files in src/. Covers: headers, sanitizer, turtle escaper, validator, WordPress adapter, IndieWeb (Micropub, IndieAuth, Webmention), RateLimit (TokenBucket, Store, RateLimiter).
- Sanitizer: property tests with arbitrary HTML/JS input
- Validator: property tests for all input types
- Rate limiter: property tests for token bucket invariants (never negative, refill correctness)
- Headers: property tests for CSP generation correctness
- Full request lifecycle: incoming request -> sanitize -> validate -> rate check -> process -> headers
- WordPress integration: full plugin activation -> request -> response with security headers
- IndieWeb: full Micropub/IndieAuth/Webmention flow with validation
- Security: XSS test exists (test-cf7-xss.php, good). Missing: SQL injection, CSRF bypass, header injection, rate limiter bypass, authentication timing attacks — a security library needs exhaustive security tests
- Performance: No request processing overhead benchmarks
- Concurrency: No tests for rate limiter under concurrent requests
- Error handling: No tests for malformed headers, invalid token formats, WordPress incompatibility
- PHPUnit runner setup
- Composer autoload verification
- WordPress test environment
- Header generation overhead per request
- Sanitizer throughput per input size
- Rate limiter decision time
- Validator throughput
- Security header compliance verification
- Rate limiter self-test under load
- Validator coverage report (all input types tested)
HIGH. 14 source files with 11 test files is actually a good ratio (79%). But this is a SECURITY library — the test depth needs to be extreme, not just file-count-adequate. The XSS real-world test is commendable. Missing: fuzzing, property tests for all security functions, concurrency tests for the rate limiter. No benchmarks means you cannot prove the security overhead is acceptable.
tests/fuzz/placeholder.txtis a scorecard placeholder inherited from rsr-template-repo — it does NOT provide real fuzz testing- Replace with an actual fuzz harness (see rsr-template-repo/tests/fuzz/README.adoc) or remove the file
- Priority: P2 — creates false impression of fuzz coverage