You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+65-1Lines changed: 65 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,7 @@ Add the coverage extension to your `phpunit.xml`:
62
62
|`strip_prefixes`| No |`[]`| Comma-separated prefixes to strip from request paths (e.g., `/api`) |
63
63
|`specs`| No |`front`| Comma-separated spec names for coverage tracking |
64
64
|`output_file`| No | — | File path to write Markdown coverage report (relative paths resolve from `getcwd()`) |
65
+
|`console_output`| No |`default`| Console output mode: `default`, `all`, or `uncovered_only` (overridden by `OPENAPI_CONSOLE_OUTPUT` env var) |
65
66
66
67
*Not required if you call `OpenApiSpecLoader::configure()` manually.
67
68
@@ -163,7 +164,11 @@ For Laravel, set the `max_errors` key in `config/openapi-contract-testing.php`.
163
164
164
165
## Coverage Report
165
166
166
-
After running tests, the PHPUnit extension prints a coverage report:
167
+
After running tests, the PHPUnit extension prints a coverage report. The output format is controlled by the `console_output` parameter (or `OPENAPI_CONSOLE_OUTPUT` environment variable).
168
+
169
+
### `default` mode (default)
170
+
171
+
Shows covered endpoints individually and uncovered as a count:
167
172
168
173
```
169
174
OpenAPI Contract Test Coverage
@@ -179,6 +184,56 @@ Covered:
179
184
Uncovered: 41 endpoints
180
185
```
181
186
187
+
### `all` mode
188
+
189
+
Shows both covered and uncovered endpoints individually:
fwrite(STDERR, "[OpenAPI Coverage] WARNING: Invalid OPENAPI_CONSOLE_OUTPUT value '{$envValue}'. Valid values: default, all, uncovered_only. Falling back to 'default'.\n");
34
+
}
35
+
36
+
return$resolved ?? self::DEFAULT;
37
+
}
38
+
39
+
if ($parameterValue !== null && trim($parameterValue) !== '') {
0 commit comments