feat: adds snapshot testing

This commit is contained in:
Nuno Maduro
2023-06-17 13:26:16 +01:00
parent 17db4bd616
commit 36b585835d
17 changed files with 374 additions and 5 deletions

View File

@ -305,6 +305,14 @@ final class Expectation
return $pendingArchExpectation->$method(...$parameters); // @phpstan-ignore-line
}
if (! is_object($this->value)) {
throw new BadMethodCallException(sprintf(
'Method "%s" does not exist in %s.',
$method,
gettype($this->value)
));
}
/* @phpstan-ignore-next-line */
return new HigherOrderExpectation($this, call_user_func_array($this->value->$method(...), $parameters));
}