From b98b9c761c0a90f70ebdc533620e11b52329012c Mon Sep 17 00:00:00 2001 From: oleibman Date: Fri, 11 Jun 2021 13:29:44 -0700 Subject: [PATCH] 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"`. --- tests/PhpSpreadsheetTests/Helper/SampleTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PhpSpreadsheetTests/Helper/SampleTest.php b/tests/PhpSpreadsheetTests/Helper/SampleTest.php index 0817f1d5..bdcb2a6a 100644 --- a/tests/PhpSpreadsheetTests/Helper/SampleTest.php +++ b/tests/PhpSpreadsheetTests/Helper/SampleTest.php @@ -63,7 +63,7 @@ class SampleTest extends TestCase // } if (!in_array($sample, $skipped)) { $file = 'samples/' . $sample; - $result[] = [$file]; + $result[$sample] = [$file]; } } }