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

@ -141,7 +141,7 @@ trait Testable
}
$this->{$property} = ($this->{$property} instanceof Closure)
? ChainableClosure::from($this->{$property}, $hook)
? ChainableClosure::fromSameObject($this->{$property}, $hook)
: $hook;
}
@ -189,7 +189,7 @@ trait Testable
$beforeEach = TestSuite::getInstance()->beforeEach->get(self::$__filename)[1];
if ($this->__beforeEach instanceof Closure) {
$beforeEach = ChainableClosure::from($this->__beforeEach, $beforeEach);
$beforeEach = ChainableClosure::fromSameObject($this->__beforeEach, $beforeEach);
}
$this->__callClosure($beforeEach, func_get_args());
@ -203,7 +203,7 @@ trait Testable
$afterEach = TestSuite::getInstance()->afterEach->get(self::$__filename);
if ($this->__afterEach instanceof Closure) {
$afterEach = ChainableClosure::from($this->__afterEach, $afterEach);
$afterEach = ChainableClosure::fromSameObject($this->__afterEach, $afterEach);
}
$this->__callClosure($afterEach, func_get_args());