Skip to content

Commit 8d81015

Browse files
committed
Add support for Laravel 7
1 parent 5ac3bfd commit 8d81015

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ matrix:
1717
env: ILLUMINATE_VERSION=5.7.* TESTBENCH_VERSION=3.7.*
1818
- php: 7.2
1919
env: ILLUMINATE_VERSION=5.6.* TESTBENCH_VERSION=3.6.*
20+
- php: 7.3
21+
env: ILLUMINATE_VERSION=7.* TESTBENCH_VERSION=5.*
2022
- php: 7.3
2123
env: ILLUMINATE_VERSION=6.* TESTBENCH_VERSION=4.*
2224
- php: 7.3
@@ -25,6 +27,8 @@ matrix:
2527
env: ILLUMINATE_VERSION=5.7.* TESTBENCH_VERSION=3.7.*
2628
- php: 7.3
2729
env: ILLUMINATE_VERSION=5.6.* TESTBENCH_VERSION=3.6.*
30+
- php: 7.4
31+
env: ILLUMINATE_VERSION=7.* TESTBENCH_VERSION=5.*
2832
- php: 7.4
2933
env: ILLUMINATE_VERSION=6.* TESTBENCH_VERSION=4.*
3034
- php: 7.4

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
"php": "^7.1",
2424
"0.0.0/composer-include-files": "^1.5",
2525
"codezero/laravel-localizer": "^1.1",
26-
"illuminate/support": "^5.6|^6.0"
26+
"illuminate/support": "^5.6|^6.0|^7.0"
2727
},
2828
"require-dev": {
2929
"mockery/mockery": "^1.3",
30-
"orchestra/testbench": "^3.6|^4.0",
31-
"phpunit/phpunit": "^7.0|^8.0"
30+
"orchestra/testbench": "^3.6|^4.0|^5.0",
31+
"phpunit/phpunit": "^7.0|^8.0|^9.0"
3232
},
3333
"scripts": {
3434
"test": "phpunit"

tests/Stubs/Model.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ public function getSlug($locale = null)
3535
* Fake route model binding.
3636
*
3737
* @param string $parameter
38+
* @param string|null $field
3839
*
3940
* @return mixed
4041
*/
41-
public function resolveRouteBinding($parameter)
42+
public function resolveRouteBinding($parameter, $field = null)
4243
{
4344
// Bypass the database for testing purpose and return
4445
// the current model as if it was found in the database.

tests/Stubs/ModelWithCustomRouteParameters.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ public function getRouteParameters($locale = null)
2929
* Fake route model binding (avoid database for test purpose).
3030
*
3131
* @param int $id
32+
* @param string|null $field
3233
*
3334
* @return mixed
3435
*/
35-
public function resolveRouteBinding($id)
36+
public function resolveRouteBinding($id, $field = null)
3637
{
3738
return $this;
3839
}

tests/TestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
use CodeZero\LocalizedRoutes\LocalizedRoutesServiceProvider;
66
use CodeZero\Localizer\LocalizerServiceProvider;
77
use Illuminate\Contracts\View\View;
8-
use Illuminate\Foundation\Testing\Assert as PHPUnit;
9-
use Illuminate\Foundation\Testing\TestResponse;
108
use Illuminate\Support\Collection;
119
use Illuminate\Support\Facades\App;
1210
use Illuminate\Support\Facades\Config;
1311
use Illuminate\Support\Facades\Lang;
1412
use Illuminate\Support\Facades\Route;
13+
use Illuminate\Testing\Assert as PHPUnit;
14+
use Illuminate\Testing\TestResponse;
1515
use Orchestra\Testbench\TestCase as BaseTestCase;
1616

1717
abstract class TestCase extends BaseTestCase
@@ -27,7 +27,7 @@ protected function setUp(): void
2727

2828
TestResponse::macro('assertResponseHasNoView', function () {
2929
if (isset($this->original) && $this->original instanceof View) {
30-
return PHPUnit::fail('The response has a view.');
30+
PHPUnit::fail('The response has a view.');
3131
}
3232

3333
return $this;

0 commit comments

Comments
 (0)