mirror of
https://github.com/pestphp/pest.git
synced 2026-03-10 09:47:23 +01:00
feat(describe): snapshots
This commit is contained in:
@ -65,6 +65,6 @@ final class DescribeCall
|
||||
|
||||
$beforeEachCall->describing = $this->description;
|
||||
|
||||
return $beforeEachCall->{$name}(...$arguments);
|
||||
return $beforeEachCall->{$name}(...$arguments); // @phpstan-ignore-line
|
||||
}
|
||||
}
|
||||
|
||||
@ -345,9 +345,9 @@ final class TestCall
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
if ($this->describing) {
|
||||
$this->testCaseMethod->description = '`'.$this->describing.'` '.$this->testCaseMethod->description;
|
||||
if (! is_null($this->describing)) {
|
||||
$this->testCaseMethod->describing = $this->describing;
|
||||
$this->testCaseMethod->description = sprintf('`%s` > %s', $this->describing, $this->testCaseMethod->description);
|
||||
}
|
||||
|
||||
$this->testSuite->tests->set($this->testCaseMethod);
|
||||
|
||||
@ -29,11 +29,9 @@ final class BeforeEachRepository
|
||||
|
||||
$beforeEachTestCall = ChainableClosure::unbound($fromBeforeEachTestCall, $beforeEachTestCall);
|
||||
$beforeEachTestCase = ChainableClosure::bound($fromBeforeEachTestCase, $beforeEachTestCase)->bindTo($beforeEachCall, $beforeEachCall::class);
|
||||
assert($beforeEachTestCase instanceof Closure);
|
||||
}
|
||||
|
||||
assert($beforeEachTestCall instanceof Closure);
|
||||
assert($beforeEachTestCase instanceof Closure);
|
||||
|
||||
$this->state[$filename] = [$beforeEachTestCall, $beforeEachTestCase];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user