httpFake->sendsMessage(); app(Matrix::class)->message('lalatt'); $this->httpFake->assertMessageSent('lalatt'); } /** * @covers Matrix */ public function testItSendsMessageWithException(): void { $this->httpFake->sendsMessage(); app(Matrix::class)->exception(new TestException('The error Message')); $this->httpFake->assertMessageSent('

The error Message

'); } /** * @covers Matrix */ public function testItSendsExceptionWhenExceptionIsReported(): void { $this->httpFake->sendsMessage(); try { throw new MatrixException('This is the error'); } catch (MatrixException $e) { $e->report(); } $this->httpFake->assertMessageSent('

This is the error

'); } /** * @covers Matrix */ public function testItSendsExceptionsWithStringParameters(): void { $this->httpFake->sendsMessage(); app(Matrix::class)->exception((new StringPropertyException('This is the error', '::param content::', 'third param'))); $this->httpFake->assertMessageSent('

This is the error

'); } } class TestException extends Exception { } class MatrixException extends Exception { use ReportsToMatrix; } class StringPropertyException extends HttpClientException { public function __construct(public $message, public string $testParam, public string $thirdParam) { parent::__construct($message); } }