revert previous solution and invert chain and proxy calls in TestCaseFactory.php

This commit is contained in:
Fabio Ivona
2021-10-02 09:09:47 +02:00
parent e042bf7d3a
commit 2a649bdfc0
2 changed files with 1 additions and 25 deletions

View File

@ -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());

View File

@ -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]);
}
}
}
}