php-agentic/tests/Feature
darbs-claude 91ee71b8a1
Some checks failed
CI / PHP 8.3 (pull_request) Failing after 1m37s
CI / PHP 8.4 (pull_request) Failing after 1m36s
fix: improve template variable error messages (#30)
Enhance `validateVariables()` in `PlanTemplateService` to produce
actionable errors instead of the generic "Required variable '...' is missing".

Changes:
- Extracted `buildVariableError()` helper that composes the message from
  the variable's `description`, `format`, `example`, and `examples` fields
- Added `naming_convention` key to the returned array so callers have
  a constant reminder that variable names use snake_case
- Added a `NAMING_CONVENTION` private const to avoid string duplication

Tests (6 new cases in `PlanTemplateServiceTest`):
- description included in error message
- single `example` value included
- `examples` list (first two) included
- `format` hint included alongside example
- `naming_convention` present in both valid and invalid results
- bare variable (no description) still produces useful "missing" message

Closes #30

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 11:48:27 +00:00
..
Jobs style: fix pint code style issues 2026-02-23 06:42:24 +00:00
Livewire test: add Livewire component tests for all 12 admin components 2026-02-23 01:16:33 +00:00
.gitkeep Initial commit 2026-01-26 23:20:30 +00:00
AgentApiKeyServiceTest.php refactor(tests): convert IpRestrictionServiceTest to Pest functional syntax 2026-01-29 18:50:41 +00:00
AgentApiKeyTest.php refactor(tests): convert AgentApiKey tests to Pest functional syntax 2026-01-29 18:42:56 +00:00
AgentPhaseTest.php perf: replace N+1 find() with whereIn batch lookup in checkDependencies() 2026-02-23 10:40:00 +00:00
AgentPlanTest.php chore: fix pint code style and add test config 2026-02-23 03:50:09 +00:00
AgentSessionTest.php chore: fix pint code style and add test config 2026-02-23 03:50:09 +00:00
ApiKeyManagerTest.php style: fix pint code style issues 2026-02-23 06:42:24 +00:00
ContentServiceTest.php fix: add batch failure recovery to ContentService (#27) 2026-02-23 11:17:56 +00:00
ForAgentsControllerTest.php style: fix pint code style issues 2026-02-23 06:42:24 +00:00
IpRestrictionServiceTest.php refactor(tests): convert IpRestrictionServiceTest to Pest functional syntax 2026-01-29 18:50:41 +00:00
PlanTemplateServiceTest.php fix: improve template variable error messages (#30) 2026-02-23 11:48:27 +00:00
PromptVersionTest.php test: add PromptVersion model tests 2026-02-23 05:18:37 +00:00
SecurityTest.php chore: fix pint code style and add test config 2026-02-23 03:50:09 +00:00