Skip to content

Commit 74745d4

Browse files
Apply suggestions from code review
Co-authored-by: Alain Schlesser <[email protected]>
1 parent da6c27d commit 74745d4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

utils/generate-coverage.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* This script is added via `--require` to the WP-CLI commands executed by the Behat test runner.
5+
* It starts coverage collection right away and registers a shutdown hook to complete it
6+
* after the respective WP-CLI command has finished.
7+
*/
8+
39
use SebastianBergmann\CodeCoverage\CodeCoverage;
410
use SebastianBergmann\CodeCoverage\Driver\Selector;
511
use SebastianBergmann\CodeCoverage\Filter;
@@ -20,6 +26,10 @@
2026
$filter
2127
);
2228

29+
/*
30+
* The names of the current feature and scenario are passed on from the Behat test runner
31+
* to this script through environment variables `BEHAT_FEATURE_TITLE` & `BEHAT_SCENARIO_TITLE`.
32+
*/
2333
$feature = getenv( 'BEHAT_FEATURE_TITLE' );
2434
$scenario = getenv( 'BEHAT_SCENARIO_TITLE' );
2535
$name = "{$feature} - {$scenario}";

0 commit comments

Comments
 (0)