implemented support for PHPUnit's @depends

This commit is contained in:
Adrian Nürnberger
2020-06-19 19:50:54 +02:00
parent 283d8f3e03
commit d0a74931dd
7 changed files with 120 additions and 12 deletions

View File

@ -18,10 +18,10 @@ final class ExceptionTrace
* Ensures the given closure reports
* the good execution context.
*/
public static function ensure(Closure $closure): void
public static function ensure(Closure $closure): Mixed
{
try {
$closure();
return new Mixed($closure());
} catch (Throwable $throwable) {
if (Str::startsWith($message = $throwable->getMessage(), self::UNDEFINED_METHOD)) {
$message = str_replace(self::UNDEFINED_METHOD, 'Call to undefined method ', $message);