diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 250c2c5..a28a4d8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,22 +10,27 @@ on: jobs: ci: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: - os: [ubuntu-latest, macos-latest] - php: ['7.3', '7.4', '8.0', '8.1'] + + php: [ 7.3, 7.4, 8.0, 8.1 ] + laravel: [ 8.*, 9.* ] dependency-version: [prefer-lowest, prefer-stable] - exclude: - - php: 8.1 - dependency-version: prefer-lowest - - php: 8.1 - os: macos-latest - - php: 8.1 - os: windows-latest + include: + - laravel: 8.* + testbench: ^6.25 + - laravel: 9.* + testbench: ^7.0 - name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} + exclude: + - laravel: 9.* + php: 7.3 + - laravel: 9.* + php: 7.4 + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - name: Checkout @@ -44,7 +49,9 @@ jobs: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Install PHP dependencies - run: composer update --${{ matrix.dependency-version }} --no-interaction --no-progress --ansi + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --ansi - - name: Unit Tests + - name: Execute Tests run: ./vendor/bin/pest --colors=always diff --git a/composer.json b/composer.json index 0b7efa0..1b22f16 100644 --- a/composer.json +++ b/composer.json @@ -29,9 +29,14 @@ ], "require": { "php": "^7.3 || ^8.0 || ^8.1", + "illuminate/contracts": "^7.0 || ^8.0 || ^9.0", + "illuminate/database": "^7.0 || ^8.0 || ^9.0", + "illuminate/http": "^7.0 || ^8.0 || ^9.0", + "illuminate/support": "^7.0 || ^8.0 || ^9.0", + "illuminate/testing": "^7.0 || ^8.0 || ^9.0", "pestphp/pest": "^1.0", "pestphp/pest-plugin": "^1.0", - "pestphp/pest-plugin-laravel": "^1.1" + "pestphp/pest-plugin-laravel": "^1.2" }, "autoload": { "psr-4": { @@ -47,7 +52,7 @@ } }, "require-dev": { - "orchestra/testbench": "^6.21", + "orchestra/testbench": "^6.21 || ^7.0", "pestphp/pest-dev-tools": "dev-master" }, "extra": { diff --git a/src/Expectations/Models.php b/src/Expectations/Models.php index 8b1765d..893937d 100644 --- a/src/Expectations/Models.php +++ b/src/Expectations/Models.php @@ -14,7 +14,7 @@ use Illuminate\Database\Eloquent\Relations\HasOne; use Pest\Expectation; use function Pest\Laravel\assertDatabaseHas; -use function Pest\Laravel\assertDeleted; +use function Pest\Laravel\assertModelMissing; use function Pest\Laravel\assertSoftDeleted; use function PHPUnit\Framework\assertEquals; use function PHPUnit\Framework\assertTrue; @@ -25,7 +25,7 @@ * Assert that the given model is deleted. */ function (): Expectation { - assertDeleted($this->value); + assertModelMissing($this->value); return $this; } diff --git a/tests/Expect/Response/toBeRedirect.php b/tests/Expect/Response/toBeRedirect.php index 3fdce9a..0305633 100644 --- a/tests/Expect/Response/toBeRedirect.php +++ b/tests/Expect/Response/toBeRedirect.php @@ -19,7 +19,7 @@ $response = get('/ok'); expect($response)->toBeRedirect(); -})->throws(ExpectationFailedException::class, 'Response status code [200] is not a redirect status code'); +})->throws(ExpectationFailedException::class); test('fails with uri check', function () { $response = get('/redirect/out'); diff --git a/tests/Expect/Response/toBeRedirectToSignedRoute.php b/tests/Expect/Response/toBeRedirectToSignedRoute.php index 580d3b8..112b229 100644 --- a/tests/Expect/Response/toBeRedirectToSignedRoute.php +++ b/tests/Expect/Response/toBeRedirectToSignedRoute.php @@ -24,7 +24,7 @@ } expect($response)->toBeRedirectToSignedRoute('status', 200); -})->throws(ExpectationFailedException::class, 'Response status code [200] is not a redirect status code'); +})->throws(ExpectationFailedException::class); test('fails parameter checking', function () { $response = get('/redirect-signed');