Skip to content

Commit a7fd0b2

Browse files
committed
Merge branch 'release/v2.2'
2 parents a291f2a + a3f1874 commit a7fd0b2

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Teststatistics.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ public function _initialize()
4747
// we are printing test status and time taken
4848
public function beforeTest(TestEvent $e)
4949
{
50-
$testName = $e->getTest()->toString();
51-
preg_match('#\((.*?)\)#', $testName, $fileName);
52-
53-
self::$tmpCurrentTest = $fileName[1];
50+
self::$tmpCurrentTest = \Codeception\Test\Descriptor::getTestFileName($e->getTest());
5451
}
5552

5653
// we are printing test status and time taken
@@ -83,9 +80,7 @@ public function afterStep(StepEvent $e)
8380
public function afterTest(TestEvent $e)
8481
{
8582
$test = new \stdClass;
86-
$testName = $e->getTest()->toString();
87-
preg_match('#\((.*?)\)#', $testName, $fileName);
88-
$test->name = $fileName[1];
83+
$test->name = \Codeception\Test\Descriptor::getTestFileName($e->getTest());
8984

9085

9186
// stack overflow: http://stackoverflow.com/questions/16825240/how-to-convert-microtime-to-hhmmssuu

0 commit comments

Comments
 (0)