mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
revert previous solution and invert chain and proxy calls in TestCaseFactory.php
This commit is contained in:
@ -140,16 +140,12 @@ final class TestCaseFactory
|
||||
$proxies = $this->proxies;
|
||||
$factoryTest = $this->test;
|
||||
|
||||
if ($chains->hasMessage('markTestSkipped')) {
|
||||
$proxies->forgetMessage('expectException');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
$test = function () use ($chains, $proxies, $factoryTest) {
|
||||
$proxies->proxy($this);
|
||||
$chains->chain($this);
|
||||
$proxies->proxy($this);
|
||||
|
||||
/* @phpstan-ignore-next-line */
|
||||
return call_user_func(Closure::bind($factoryTest, $this, get_class($this)), ...func_get_args());
|
||||
|
||||
@ -69,24 +69,4 @@ final class HigherOrderMessageCollection
|
||||
0,
|
||||
);
|
||||
}
|
||||
|
||||
public function hasMessage(string $name): bool
|
||||
{
|
||||
foreach ($this->messages as $message) {
|
||||
if ($message->name === $name) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function forgetMessage(string $name): void
|
||||
{
|
||||
foreach ($this->messages as $index => $message) {
|
||||
if ($message->name === $name) {
|
||||
unset($this->messages[$index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user