feat(describe): refactor

This commit is contained in:
Nuno Maduro
2023-05-26 19:56:10 +01:00
parent 3e8616ec64
commit 68ea2c7d7e
7 changed files with 33 additions and 85 deletions

View File

@ -22,45 +22,45 @@ final class TestCaseMethodFactory
use HigherOrderable;
/**
* D=fghjkl
* The test's describing, if any.
*/
public ?string $describing = null;
/**
* Determines if the Test Case Method is a "todo".
* Determines if the test is a "todo".
*/
public bool $todo = false;
/**
* The Test Case Dataset, if any.
* The test's datasets.
*
* @var array<Closure|iterable<int|string, mixed>|string>
*/
public array $datasets = [];
/**
* The Test Case depends, if any.
* The test's dependencies.
*
* @var array<int, string>
*/
public array $depends = [];
/**
* The Test Case groups, if any.
* The test's groups.
*
* @var array<int, string>
*/
public array $groups = [];
/**
* The covered classes and functions, if any.
* The covered classes and functions.
*
* @var array<int, \Pest\Factories\Covers\CoversClass|\Pest\Factories\Covers\CoversFunction|\Pest\Factories\Covers\CoversNothing>
*/
public array $covers = [];
/**
* Creates a new Factory instance.
* Creates a new test case method factory instance.
*/
public function __construct(
public string $filename,
@ -75,7 +75,7 @@ final class TestCaseMethodFactory
}
/**
* Makes the Test Case classes.
* Creates the test's closure.
*/
public function getClosure(TestCase $concrete): Closure
{
@ -89,7 +89,6 @@ final class TestCaseMethodFactory
$testCase = TestSuite::getInstance()->tests->get($this->filename);
$concrete->__describeDescription = $this->describing; // @phpstan-ignore-line
$testCase->factoryProxies->proxy($concrete);
$this->factoryProxies->proxy($concrete);