php-agentic/tests
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
..
Feature refactor(tests): convert PlanTemplateServiceTest to Pest functional syntax 2026-01-29 18:56:51 +00:00
Unit test: add AgentDetection service unit tests 2026-02-23 01:40:47 +00:00
UseCase refactor: update namespaces for L1/L2 package convention 2026-01-27 17:34:46 +00:00
Pest.php refactor(tests): convert AgentApiKey tests to Pest functional syntax 2026-01-29 18:42:56 +00:00
TestCase.php Initial commit 2026-01-26 23:20:30 +00:00