Skip to content

Commit

Permalink
Fix tests on older Laravel versions
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive committed Apr 11, 2024
1 parent e6c72bc commit 6d12095
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/Sentry/Integration/ModelViolationReportersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Sentry\Integration;

use Illuminate\Database\Eloquent\MissingAttributeException;
use Illuminate\Database\Eloquent\Model;
use Sentry\Laravel\Integration;
use Sentry\Laravel\Tests\TestCase;
Expand All @@ -12,6 +13,15 @@
*/
class ModelViolationReportersTest extends TestCase
{
protected function setUp(): void
{
if (!class_exists(MissingAttributeException::class)) {
$this->markTestSkipped('Laravel introduced model violations in version 9.');
}

parent::setUp();
}

public function testModelViolationReportersCanBeRegistered(): void
{
$this->expectNotToPerformAssertions();
Expand Down

0 comments on commit 6d12095

Please sign in to comment.