Adds tap for Higher Order tests

This commit is contained in:
luke
2021-06-24 22:57:26 +01:00
parent 4f67eff619
commit acef002a2d
5 changed files with 78 additions and 5 deletions

View File

@ -41,15 +41,25 @@ final class Reflection
}
if (is_callable($method)) {
return Closure::fromCallable($method)->bindTo(
TestSuite::getInstance()->test
)(...$args);
return static::bindCallable($method, $args);
}
throw $exception;
}
}
/**
* Bind a callable to the TestCase and return the result.
*
* @param array<int, mixed> $args
*
* @return mixed
*/
public static function bindCallable(callable $callable, array $args = [])
{
return Closure::fromCallable($callable)->bindTo(TestSuite::getInstance()->test)(...$args);
}
/**
* Infers the file name from the given closure.
*/