Это пример для Laravel, но этот подход должен работать для любой платформы.
use Sentry\Client;
use Sentry\EventFactory;
use Sentry\Options;
use Sentry\Serializer\RepresentationSerializer;
use Sentry\Serializer\Serializer;
use Sentry\Transport\NullTransport;
private function mockSentry(): void
{
/** @var \Sentry\State\Hub $sentry */
$sentry = $this->app['sentry']; // Get sentry object from Laravel's container
$client = new Client(
new Options(),
new NullTransport(),
new EventFactory(
new Serializer(new Options()),
new RepresentationSerializer(new Options()),
new Options(),
'1',
'1',
),
);
$sentry->bindClient($client);
}