Skip to content

Commit aaa40e2

Browse files
committed
convert method name to camelCase
1 parent 2c2c11e commit aaa40e2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PrettyPrinter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ public function endTest(Test $test, $time)
2929
parent::endTest($test, $time);
3030

3131
$testMethodName = explode('::', \PHPUnit\Util\Test::describe($test));
32-
preg_match_all('/((?:^|[A-Z])[a-z]+)/', $testMethodName[1], $matches);
3332

33+
// convert snakeCase method name to camelCase
34+
$testMethodName[1] = str_replace('_', '', ucwords($testMethodName[1], '_'));
35+
36+
preg_match_all('/((?:^|[A-Z])[a-z]+)/', $testMethodName[1], $matches);
3437
$testNameArray = array_map('strtolower', $matches[0]);
3538
array_shift($testNameArray);
3639
$name = implode(' ', $testNameArray);

0 commit comments

Comments
 (0)