mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-03-15 03:39:50 +01:00
Use more helpful code test names
This commit is contained in:
parent
f57d217e91
commit
fe6755ff4c
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user