Skip to content

Commit

Permalink
Merge pull request #594 from inertiajs/remove-deprecated-assert-class
Browse files Browse the repository at this point in the history
[1.x] Remove deprecated `Assert` class and Laravel 6 & 7 support.
  • Loading branch information
jessarcher authored Mar 9, 2024
2 parents 861e990 + 7f4a008 commit ac686bf
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1,213 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,10 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4, "8.0", 8.1, 8.2, 8.3]
laravel: [6, 7, 8, 9, 10, 11]
php: [7.3, 7.4, "8.0", 8.1, 8.2, 8.3]
laravel: [8, 9, 10, 11]
stability: ["prefer-lowest", "prefer-stable"]
exclude:
- php: 7.2
laravel: 8
- php: 7.2
laravel: 9
- php: 7.2
laravel: 10
- php: 7.2
laravel: 11
- php: 7.3
laravel: 9
- php: 7.3
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
}
},
"require": {
"php": "^7.2|~8.0.0|~8.1.0|~8.2.0|~8.3.0",
"php": "^7.3|~8.0.0|~8.1.0|~8.2.0|~8.3.0",
"ext-json": "*",
"laravel/framework": "^6.0|^7.0|^8.74|^9.0|^10.0|^11.0"
"laravel/framework": "^8.74|^9.0|^10.0|^11.0"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"orchestra/testbench": "^4.0|^5.0|^6.4|^7.0|^8.0|^9.0",
"orchestra/testbench": "^6.4|^7.0|^8.0|^9.0",
"mockery/mockery": "^1.3.3",
"phpunit/phpunit": "^8.0|^9.5.8|^10.4"
},
Expand Down
92 changes: 0 additions & 92 deletions src/Testing/Assert.php

This file was deleted.

13 changes: 2 additions & 11 deletions src/Testing/TestResponseMacros.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
namespace Inertia\Testing;

use Closure;
use Illuminate\Testing\Fluent\AssertableJson;

class TestResponseMacros
{
public function assertInertia()
{
return function (Closure $callback = null) {
if (class_exists(AssertableJson::class)) {
$assert = AssertableInertia::fromTestResponse($this);
} else {
$assert = Assert::fromTestResponse($this);
}
$assert = AssertableInertia::fromTestResponse($this);

if (is_null($callback)) {
return $this;
Expand All @@ -29,11 +24,7 @@ public function assertInertia()
public function inertiaPage()
{
return function () {
if (class_exists(AssertableJson::class)) {
return AssertableInertia::fromTestResponse($this)->toArray();
}

return Assert::fromTestResponse($this)->toArray();
return AssertableInertia::fromTestResponse($this)->toArray();
};
}
}
Loading

0 comments on commit ac686bf

Please sign in to comment.