Template coverage
A test suite says what it checks; coverage says what it reaches. With coverage on, every local request notes which templates it read, which of their tags ran, and which branch each {if} and {case} took. The report then shows each template with the parts that never ran marked.
|
PHP fragments/coverage_1.php |
HTML fragments/coverage_1.pad |
Result |
|---|---|---|
|
|
{if $stock gt 0}In stock{else}Sold out{/if}
|
-
$padCoverage = TRUEin_config/config.phprecords into the rundefault; a name instead of TRUE records into a run of that name, and?page&padCoverage=namerecords one request. -
develop/?coverage&start=suitesrecords every local request of every application untildevelop/?coverage&stop- start it, run the suites, stop it, anddevelop/?coverage&run=suiteslists every template with the share of its tags and branches that ran, and the files no request read at all. - A run is a file of JSON lines,
DATA/coverage/<run>.jsonl, one line per request. Only local requests are recorded. - An {if} without an {else} has one branch more: the run in which its condition was false. It is marked on the {/if}.