Skip to content

Commit 1fcc580

Browse files
committed
Overload runTest()
Avoids potential issues with setting the incorrect name in the parent class for any longer than necessary.
1 parent 3346b41 commit 1fcc580

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/AsyncTestCase.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,20 @@ abstract class AsyncTestCase extends PHPUnitTestCase
1919

2020
public function setName($name)
2121
{
22-
parent::setName('runAsyncTest');
23-
22+
parent::setName($name);
2423
$this->realTestName = $name;
2524
}
2625

27-
public function getName($withDataSet = true)
26+
protected function runTest()
2827
{
29-
parent::setName($this->realTestName);
30-
31-
try {
32-
return parent::getName($withDataSet);
33-
} finally {
34-
parent::setName('runAsyncTest');
35-
}
28+
parent::setName('runAsyncTest');
29+
return parent::runTest();
3630
}
3731

3832
final public function runAsyncTest(...$args)
3933
{
34+
parent::setName($this->realTestName);
35+
4036
$returnValue = null;
4137

4238
try {

0 commit comments

Comments
 (0)