php-admin/tests/Feature
Claude 2e50e4e25e
test: add unit tests for Model methods
Add comprehensive Pest tests for HoneypotHit and Service model methods:

HoneypotHitModelTest (50 tests):
- Bot detection (detectBot) for 15+ user agents incl. case-insensitive matching
- Severity classification (severityForPath, constants, configurable paths)
- Query scopes (recent, fromIp, bots, critical, warning) with chaining
- Model configuration (fillable, casts, constants)
- Mass assignment and persistence round-trips
- getStats aggregation (totals, unique IPs, top IPs/bots)

ServiceModelTest (45 tests):
- Query scopes (enabled, public, featured, ordered, withMarketingDomain) with chaining
- findByCode lookup and case sensitivity
- getDomainMappings filtering (disabled, missing domain/class)
- Marketing URL accessor fallback logic
- Metadata helpers (hasMeta, getMeta, setMeta) incl. key validation
- Model configuration (table, fillable, casts, constants)
- Mass assignment and persistence round-trips

Also adds tests/Pest.php to bootstrap Orchestra Testbench and register
the Core\Mod\Hub\ PSR-4 namespace for package module autoloading.

Fixes #8

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:55:49 +00:00
..
Forms test(forms): add authorization props tests for form components 2026-01-29 13:33:14 +00:00
Honeypot fix(security): improve TeapotController header sanitization (#13) 2026-02-20 11:50:04 +00:00
Layout test(layout): add comprehensive tests for HLCRF layout system 2026-01-29 19:27:30 +00:00
Menu test(honeypot): add comprehensive tests for teapot/honeypot anti-spam system 2026-01-29 19:14:45 +00:00
Modal test(modal): add comprehensive tests for Livewire modal system 2026-01-29 19:23:17 +00:00
Models test: add unit tests for Model methods 2026-03-24 16:55:49 +00:00
Search test(search): add comprehensive tests for search provider registry 2026-01-29 19:18:33 +00:00
Security security: add rate limiting to admin action endpoints (#12) 2026-02-20 11:28:26 +00:00
.gitkeep Initial commit 2026-01-26 20:48:24 +00:00