Improve Identification of Samples in Coverage Report (#2153)

The Phpunit coverage report currently contains bullet items like `PhpOffice\PhpSpreadsheetTests\Helper\SampleTest\testSample with data set "49"`. This extremely simple change takes advantage of Phpunit's ability to accept an array with keys which are either strings or integers, by using the sample filenames as the array keys rather than sequential but otherwise meaningless integers (e.g. `49` in the earlier cited item). The bullet item will now read `PhpOffice\PhpSpreadsheetTests\Helper\SampleTest\testSample with data set "Basic/38_Clone_worksheet.php"`.
This commit is contained in:
oleibman 2021-06-11 13:29:44 -07:00 committed by GitHub
parent 9c2ce22505
commit b98b9c761c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ class SampleTest extends TestCase
// } // }
if (!in_array($sample, $skipped)) { if (!in_array($sample, $skipped)) {
$file = 'samples/' . $sample; $file = 'samples/' . $sample;
$result[] = [$file]; $result[$sample] = [$file];
} }
} }
} }