diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d7f6f77..0443d66 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,14 +9,16 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.2,8.3] - laravel: [10.*] + php: [8.2, 8.3] + laravel: ["^11.0", "^10.0"] dependency-version: [prefer-stable] include: - - laravel: 10.* - testbench: 8.* + - laravel: "^11.0" + testbench: 9.* + - laravel: "^10.0" + testbench: 8.* - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - name: Checkout code diff --git a/composer.json b/composer.json index f408f06..5c1c5fb 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,8 @@ "keywords": [ "laravel", "laravel eloquent", + "laravel delete", + "laravel destroy model", "eloquent", "soft deletes" ], @@ -19,14 +21,14 @@ ], "require": { "php": "^8.2", - "illuminate/config": "^10.0", - "illuminate/container": "^10.0", - "illuminate/contracts": "^10.0", - "illuminate/database": "^10.0" + "illuminate/config": "^10.0|^11.0", + "illuminate/container": "^10.0|^11.0", + "illuminate/contracts": "^10.0|^11.0", + "illuminate/database": "^10.0|^11.0" }, "require-dev": { - "orchestra/testbench": "^8.8", - "phpunit/phpunit": "^10.0" + "orchestra/testbench": "^8.0|^9.0", + "phpunit/phpunit": "^9.4|^10.1" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ba7958d..ed1a499 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,23 +1,22 @@ - - - tests - - - - - app - - - - - - - + + + src/ + + + + + tests + + + + + + + - diff --git a/tests/NoneDeletableUserMessageTest.php b/tests/NoneDeletableUserMessageTest.php index ef8f62a..3438503 100644 --- a/tests/NoneDeletableUserMessageTest.php +++ b/tests/NoneDeletableUserMessageTest.php @@ -6,14 +6,11 @@ use F9Web\LaravelDeletable\Exceptions\NoneDeletableModel; use F9Web\LaravelDeletable\Tests\Models\User; -use Illuminate\Foundation\Testing\RefreshDatabase; use function get_class; class NoneDeletableUserMessageTest extends TestCase { - use RefreshDatabase; - /** * @test * @throws \Exception @@ -53,7 +50,7 @@ public function isDeletable(): bool { // the user with the email 'rob@f9web.co.uk' is a // core record and therefore not deletable - if ($this->email === 'rob@f9web.co.uk') { + if ($this->email === 'rob1@f9web.co.uk') { return $this->isCoreEntity(); } @@ -63,7 +60,7 @@ public function isDeletable(): bool $class = get_class($model); - $user = $model::query()->create($record = ['email' => 'rob@f9web.co.uk']); + $user = $model::query()->create($record = ['email' => 'rob1@f9web.co.uk']); $this->expectExceptionMessage( "[{$class} #{$user->getKey()}] is a core record and therefore not deletable. This indicates " . diff --git a/tests/NoneDeletableUserTest.php b/tests/NoneDeletableUserTest.php index 0803395..5424f1c 100644 --- a/tests/NoneDeletableUserTest.php +++ b/tests/NoneDeletableUserTest.php @@ -7,14 +7,11 @@ use F9Web\LaravelDeletable\Exceptions\NoneDeletableModel; use F9Web\LaravelDeletable\Tests\Models\NoneDeletableUser; use F9Web\LaravelDeletable\Tests\Models\User; -use Illuminate\Foundation\Testing\RefreshDatabase; use function get_class; class NoneDeletableUserTest extends TestCase { - use RefreshDatabase; - /** * @test * @throws \Exception