ExceptionHandlerFake
class ExceptionHandlerFake implements ExceptionHandler, Fake mixin Handler (View source)
Traits
Properties
protected Throwable> | $reported | All of the exceptions that have been reported. |
|
protected bool | $throwOnReport | If the fake should throw exceptions when they are reported. |
Methods
Forward a method call to the given object.
Forward a method call to the given object, returning $this if the forwarded call returned itself.
Throw a bad method call exception for the given method.
Get the class name of the first parameter of the given Closure.
Get the class names of the first parameter of the given Closure, including union types.
Get the class names / types of the parameters of the given Closure.
Get the underlying handler implementation.
Assert if an exception of the given type has been reported.
Assert the number of exceptions that have been reported.
Assert if an exception of the given type has not been reported.
Assert nothing has been reported.
Determine if the handler is running without exception handling.
Throw exceptions when they are reported.
Throw the first reported exception.
Handle dynamic method calls to the handler.
Details
protected mixed
forwardCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object.
protected mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object, returning $this if the forwarded call returned itself.
static protected never
throwBadMethodCallException(string $method)
Throw a bad method call exception for the given method.
protected string
firstClosureParameterType(Closure $closure)
Get the class name of the first parameter of the given Closure.
protected array
firstClosureParameterTypes(Closure $closure)
Get the class names of the first parameter of the given Closure, including union types.
protected array
closureParameterTypes(Closure $closure)
Get the class names / types of the parameters of the given Closure.
void
assertReported(Closure|string $exception)
Assert if an exception of the given type has been reported.
void
assertNotReported(Closure|string $exception)
Assert if an exception of the given type has not been reported.
protected bool
runningWithoutExceptionHandling()
Determine if the handler is running without exception handling.
$this
setHandler(ExceptionHandler $handler)
Set the "original" handler that should be used by the fake.