From fe6755ff4c0f62067d3d57ef108e2caf11e2e07f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 25 Aug 2015 21:36:08 +0200 Subject: [PATCH] Use more helpful code test names --- test/PhpParser/CodeTestAbstract.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/PhpParser/CodeTestAbstract.php b/test/PhpParser/CodeTestAbstract.php index dddd6120..16389bb0 100644 --- a/test/PhpParser/CodeTestAbstract.php +++ b/test/PhpParser/CodeTestAbstract.php @@ -28,11 +28,14 @@ abstract class CodeTestAbstract extends \PHPUnit_Framework_TestCase // first part is the name $name = array_shift($parts) . ' (' . $fileName . ')'; + $shortName = basename($fileName, '.test'); // multiple sections possible with always two forming a pair - foreach (array_chunk($parts, 2) as $chunk) { + $chunks = array_chunk($parts, 2); + foreach ($chunks as $i => $chunk) { + $dataSetName = $shortName . (count($chunks) > 1 ? '#' . $i : ''); list($expected, $mode) = $this->extractMode(canonicalize($chunk[1])); - $tests[] = array($name, $chunk[0], $expected, $mode); + $tests[$dataSetName] = array($name, $chunk[0], $expected, $mode); } }