ExceptionHandlerFake
class ExceptionHandlerFake implements ExceptionHandler, Fake mixin Handler (View source)
Traits
| ForwardsCalls | |
| ReflectsClosures |
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
| mixed | forwardCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object. | from ForwardsCalls |
| mixed | forwardDecoratedCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object, returning $this if the forwarded call returned itself. | from ForwardsCalls |
| static void | throwBadMethodCallException(string $method)
Throw a bad method call exception for the given method. | from ForwardsCalls |
| string | firstClosureParameterType(Closure $closure)
Get the class name of the first parameter of the given Closure. | from ReflectsClosures |
| array | firstClosureParameterTypes(Closure $closure)
Get the class names of the first parameter of the given Closure, including union types. | from ReflectsClosures |
| array | closureParameterTypes(Closure $closure)
Get the class names / types of the parameters of the given Closure. | from ReflectsClosures |
| void | __construct(ExceptionHandler $handler, array $exceptions = [])
Create a new exception handler fake. | |
| ExceptionHandler | handler()
Get the underlying handler implementation. | |
| void | assertReported(Closure|string $exception)
Assert if an exception of the given type has been reported. | |
| void | assertReportedCount(int $count)
Assert the number of exceptions that have been reported. | |
| void | assertNotReported(Closure|string $exception)
Assert if an exception of the given type has not been reported. | |
| void | assertNothingReported()
Assert nothing has been reported. | |
| void | report(Throwable $e)
Report or log an exception. | |
| bool | isFakedException(Throwable $e)
Determine if the given exception is faked. | |
| bool | shouldReport(Throwable $e)
Determine if the exception should be reported. | |
| bool | runningWithoutExceptionHandling()
Determine if the handler is running without exception handling. | |
| Response | render(Request $request, Throwable $e)
Render an exception into an HTTP response. | |
| void | renderForConsole(OutputInterface $output, Throwable $e)
Render an exception to the console. | |
| $this | throwOnReport()
Throw exceptions when they are reported. | |
| $this | throwFirstReported()
Throw the first reported exception. | |
| $this | setHandler(ExceptionHandler $handler)
Set the "original" handler that should be used by the fake. | |
| mixed | __call(string $method, array $parameters)
Handle dynamic method calls to the mailer. |
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 void 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 __construct(ExceptionHandler $handler, array $exceptions = [])
Create a new exception handler fake.
ExceptionHandler handler()
Get the underlying handler implementation.
void assertReported(Closure|string $exception)
Assert if an exception of the given type has been reported.
void assertReportedCount(int $count)
Assert the number of exceptions that have been reported.
void assertNotReported(Closure|string $exception)
Assert if an exception of the given type has not been reported.
void assertNothingReported()
Assert nothing has been reported.
void report(Throwable $e)
Report or log an exception.
protected bool isFakedException(Throwable $e)
Determine if the given exception is faked.
bool shouldReport(Throwable $e)
Determine if the exception should be reported.
protected bool runningWithoutExceptionHandling()
Determine if the handler is running without exception handling.
void renderForConsole(OutputInterface $output, Throwable $e)
Render an exception to the console.
$this throwOnReport()
Throw exceptions when they are reported.
$this throwFirstReported()
Throw the first reported exception.
$this setHandler(ExceptionHandler $handler)
Set the "original" handler that should be used by the fake.
mixed __call(string $method, array $parameters)
Handle dynamic method calls to the mailer.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Support/Testing/Fakes/ExceptionHandlerFake.html