feat(describe): continues work around hooks

This commit is contained in:
Nuno Maduro
2023-05-26 19:29:46 +01:00
parent 465c65243d
commit 3e8616ec64
11 changed files with 132 additions and 172 deletions

View File

@ -28,7 +28,7 @@ final class AfterEachRepository
if (array_key_exists($filename, $this->state)) {
$fromAfterEachTestCase = $this->state[$filename];
$afterEachTestCase = ChainableClosure::from($fromAfterEachTestCase, $afterEachTestCase)
$afterEachTestCase = ChainableClosure::fromSameObject($fromAfterEachTestCase, $afterEachTestCase)
->bindTo($afterEachCall, $afterEachCall::class);
}
@ -44,7 +44,7 @@ final class AfterEachRepository
{
$afterEach = $this->state[$filename] ?? NullClosure::create();
return ChainableClosure::from(function (): void {
return ChainableClosure::fromSameObject(function (): void {
if (class_exists(Mockery::class)) {
if ($container = Mockery::getContainer()) {
/* @phpstan-ignore-next-line */