82 lines
2.8 KiB
JSON
82 lines
2.8 KiB
JSON
{
|
|
"task_id": "TEST-COVERAGE-POLICIES-001",
|
|
"summary": "Add PHPUnit test for the single untested authorization policy: OperationsAuthorizationPolicy. Achieves 100% policy test coverage (7/7).",
|
|
"assumptions": [
|
|
"OperationsAuthorizationPolicy follows the same pattern as the 6 tested policies (returns AuthorizationDecision).",
|
|
"Can use the existing AuthorizationPolicyTestSupport trait for consistent assertions.",
|
|
"Policy has constructor-injected dependencies (gateways) that can be mocked."
|
|
],
|
|
"scope": {
|
|
"in": [
|
|
"New: tests/Service/Access/OperationsAuthorizationPolicyTest.php"
|
|
],
|
|
"out": [
|
|
"Other policy files (already tested)",
|
|
"Production code changes",
|
|
"Service or gateway tests"
|
|
]
|
|
},
|
|
"guardrails": {
|
|
"required_guard_ids": [
|
|
"GR-TEST-001",
|
|
"GR-TEST-002",
|
|
"GR-CORE-005",
|
|
"GR-LANG-001",
|
|
"GR-LANG-002"
|
|
],
|
|
"required_quality_gate_ids": [
|
|
"QG-001",
|
|
"QG-002",
|
|
"QG-006"
|
|
]
|
|
},
|
|
"success_criteria": [
|
|
{
|
|
"id": "SC-001",
|
|
"criterion": "OperationsAuthorizationPolicyTest exists and covers every public method with allowed + denied scenarios."
|
|
},
|
|
{
|
|
"id": "SC-002",
|
|
"criterion": "Test uses AuthorizationPolicyTestSupport trait for consistent assertion patterns."
|
|
},
|
|
{
|
|
"id": "SC-003",
|
|
"criterion": "All 7 policy test files pass green (100% policy coverage)."
|
|
}
|
|
],
|
|
"implementation_steps": [
|
|
{
|
|
"id": "S1",
|
|
"title": "Analyze OperationsAuthorizationPolicy",
|
|
"description": "Read the policy file, identify public methods, constructor dependencies, and authorization decision logic.",
|
|
"guard_refs": ["GR-CORE-005"]
|
|
},
|
|
{
|
|
"id": "S2",
|
|
"title": "Write OperationsAuthorizationPolicyTest",
|
|
"description": "Use AuthorizationPolicyTestSupport trait. Test: allowed scenarios (correct permissions), denied scenarios (missing permissions, wrong scope), edge cases (null user, empty permissions).",
|
|
"guard_refs": ["GR-TEST-001", "GR-TEST-002"]
|
|
},
|
|
{
|
|
"id": "S3",
|
|
"title": "Run quality gates",
|
|
"description": "QG-001, QG-002, QG-006.",
|
|
"guard_refs": ["GR-LANG-002"]
|
|
}
|
|
],
|
|
"tests": [
|
|
"tests/Service/Access/OperationsAuthorizationPolicyTest.php"
|
|
],
|
|
"acceptance_checks": [
|
|
"SC-001: Test file has >= 6 test methods covering allowed + denied + edge cases",
|
|
"SC-002: Test class uses AuthorizationPolicyTestSupport trait (assertForbiddenDecision, assertDeniedDecision)",
|
|
"SC-003: docker compose exec php vendor/bin/phpunit tests/Service/Access/ exits 0 with all 7 policy tests passing"
|
|
],
|
|
"risks": [
|
|
{
|
|
"risk": "OperationsAuthorizationPolicy may have different constructor signature than other policies",
|
|
"mitigation": "Read the file first (S1). Adapt mocking strategy to match actual dependencies."
|
|
}
|
|
]
|
|
}
|