From 327e14dfd1ce2ee963ad4bd2852ca44f43245456 Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Thu, 11 Apr 2024 14:59:51 +0200 Subject: [PATCH] Fix tests on older Laravel versions --- test/Sentry/Integration/ModelViolationReportersTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/Sentry/Integration/ModelViolationReportersTest.php b/test/Sentry/Integration/ModelViolationReportersTest.php index 1194074e..305efadb 100644 --- a/test/Sentry/Integration/ModelViolationReportersTest.php +++ b/test/Sentry/Integration/ModelViolationReportersTest.php @@ -14,6 +14,10 @@ class ModelViolationReportersTest extends TestCase { public function testModelViolationReportersCanBeRegistered(): void { + if (!method_exists(Model::class, 'handleLazyLoadingViolationUsing')) { + $this->markTestSkipped('Laravel introduced model violations in version 9.'); + } + $this->expectNotToPerformAssertions(); Model::handleLazyLoadingViolationUsing(Integration::lazyLoadingViolationReporter());