feat: adds after

This commit is contained in:
Nuno Maduro
2024-05-08 01:24:30 +01:00
parent 04b099e87c
commit 8169382362
11 changed files with 312 additions and 16 deletions

View File

@ -34,6 +34,11 @@ final class TestCaseMethodFactory
*/
public ?string $describing = null;
/**
* The test's description, if any.
*/
public ?string $description = null;
/**
* The test's number of repetitions.
*/
@ -65,12 +70,16 @@ final class TestCaseMethodFactory
*/
public array $groups = [];
/**
* @see This property is not actually used in the codebase, it's only here to make Rector happy.
*/
public bool $__ran = false;
/**
* Creates a new test case method factory instance.
*/
public function __construct(
public string $filename,
public ?string $description,
public ?Closure $closure,
) {
$this->closure ??= function (): void {
@ -109,6 +118,8 @@ final class TestCaseMethodFactory
$testCase->chains->chain($this);
$method->chains->chain($this);
$this->__ran = true;
return \Pest\Support\Closure::bind($closure, $this, self::class)(...$arguments);
};
}