Skip to content

Commit

Permalink
Overload runTest()
Browse files Browse the repository at this point in the history
Avoids potential issues with setting the incorrect name in the parent class for any longer than necessary.
  • Loading branch information
trowski committed Feb 11, 2019
1 parent 3346b41 commit 1fcc580
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/AsyncTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,20 @@ abstract class AsyncTestCase extends PHPUnitTestCase

public function setName($name)
{
parent::setName('runAsyncTest');

parent::setName($name);
$this->realTestName = $name;
}

public function getName($withDataSet = true)
protected function runTest()
{
parent::setName($this->realTestName);

try {
return parent::getName($withDataSet);
} finally {
parent::setName('runAsyncTest');
}
parent::setName('runAsyncTest');
return parent::runTest();
}

final public function runAsyncTest(...$args)
{
parent::setName($this->realTestName);

$returnValue = null;

try {
Expand Down

0 comments on commit 1fcc580

Please sign in to comment.