mirror of
https://github.com/pestphp/pest.git
synced 2026-03-09 17:27:22 +01:00
feat: adds after
This commit is contained in:
@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user