php-agentic/tests/Unit
darbs-claude 964d6cdeb3
Some checks failed
CI / tests (pull_request) Failing after 1m1s
test: add AgentDetection service unit tests
Adds tests/Unit/AgentDetectionTest.php covering:
- User-Agent pattern matching for all AI providers (Anthropic, OpenAI,
  Google, Meta, Mistral) with model detection
- Browser UA detection returning notAnAgent (Chrome, Firefox, Safari, Edge)
- Non-agent bot detection (Googlebot, Bingbot, curl, python-requests, etc.)
- Edge cases: null, empty, whitespace-only, and generic programmatic UAs
- Structured MCP token parsing (provider:model:secret format)
- MCP header priority over User-Agent in HTTP requests
- Provider validation via isValidProvider() and getValidProviders()
- isAgentUserAgent() shorthand behaviour
- Each pattern documented with real-world UA examples

Closes #13

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 01:40:47 +00:00
..
.gitkeep Initial commit 2026-01-26 23:20:30 +00:00
AgentDetectionTest.php test: add AgentDetection service unit tests 2026-02-23 01:40:47 +00:00
AgenticManagerTest.php feat(tests): add AgenticManager tests 2026-01-29 19:23:20 +00:00
ClaudeServiceTest.php feat(tests): add AgenticManager tests 2026-01-29 19:23:20 +00:00
GeminiServiceTest.php feat(tests): add AgenticManager tests 2026-01-29 19:23:20 +00:00
OpenAIServiceTest.php feat(tests): add AgenticManager tests 2026-01-29 19:23:20 +00:00