Skip to content

Commit 7154d7f

Browse files
committed
add proper version constraints
1 parent 3260111 commit 7154d7f

File tree

3 files changed

+6
-39
lines changed

3 files changed

+6
-39
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"require": {
3434
"php": "^8.0",
3535
"illuminate/config": "^8.0 || ^9.0",
36-
"illuminate/database": "^8.53 || ^9.0",
36+
"illuminate/database": "^8.53 || ^9.27",
3737
"illuminate/support": "^8.0 || ^9.0",
3838
"spatie/laravel-package-tools": "^1.6.3"
3939
},

tests/AbleStoreNonBackedEnumTest.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

tests/LogsActivityTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Carbon\Carbon;
44
use Illuminate\Database\Eloquent\SoftDeletes;
5+
use Illuminate\Foundation\Application;
56
use Illuminate\Support\Collection;
67
use Spatie\Activitylog\LogOptions;
78
use Spatie\Activitylog\Models\Activity;
@@ -526,7 +527,10 @@ public function getActivitylogOptions(): LogOptions
526527
$this->assertSame('Draft', $this->getLastActivity()->properties['attributes']['status']);
527528
$this->assertEquals('created', $this->getLastActivity()->description);
528529
$this->assertEquals('created', $this->getLastActivity()->event);
529-
})->skip(version_compare(PHP_VERSION, '8.1', '<'), "PHP < 8.1 doesn't support enum");
530+
})->skip(
531+
version_compare(PHP_VERSION, '8.1', '<') || version_compare(Application::VERSION, '9.0', '<'),
532+
"PHP < 8.1 doesn't support enums && Laravel < 9.0 doesn't support non-backed-enum casting"
533+
);
530534

531535
it('logs int backed enum casted attribute', function () {
532536
$articleClass = new class() extends Article {

0 commit comments

Comments
 (0)