Skip to content

Commit 5612ad1

Browse files
committed
add support for Laravel 5.4
1 parent 0f53990 commit 5612ad1

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
All Notable changes to `laravel-missing-page-redirector` will be documented in this file
44

5+
## 1.2.0 - 2016-01-23
6+
7+
- add support for Laravel 5.4
8+
- drop support for Laravel 5.3
9+
510
## 1.1.0 - 2016-10-27
611

712
- add support for determining http status code for a redirect
813

9-
1014
## 1.0.0 - 2016-10-14
1115

1216
- initial release

composer.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717
],
1818
"require": {
1919
"php": "^7.0",
20-
"illuminate/http": "~5.3.0",
21-
"illuminate/routing": "~5.3.0",
22-
"illuminate/support": "~5.3.0",
20+
"illuminate/routing": "~5.4.0",
21+
"illuminate/support": "~5.4.0",
22+
"illuminate/pipeline": "~5.4.0",
2323
"spatie/url": "^1.0"
2424
},
2525
"require-dev": {
26-
"phpunit/phpunit": "5.*",
27-
"orchestra/testbench": "^3.3"
26+
"laravel/browser-kit-testing": "^1.0",
27+
"orchestra/testbench": "~3.4.0",
28+
"phpunit/phpunit": "5.*"
2829
},
2930
"autoload": {
3031
"psr-4": {

tests/TestCase.php

+20
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
namespace Spatie\MissingPageRedirector\Test;
44

5+
use Laravel\BrowserKitTesting\Concerns\MakesHttpRequests;
56
use Route;
67
use Illuminate\Contracts\Http\Kernel;
78
use Orchestra\Testbench\TestCase as Orchestra;
89
use Spatie\MissingPageRedirector\RedirectsMissingPages;
10+
use PHPUnit_Framework_Assert as PHPUnit;
911

1012
abstract class TestCase extends Orchestra
1113
{
14+
use MakesHttpRequests;
15+
1216
public function setUp()
1317
{
1418
parent::setUp();
@@ -51,4 +55,20 @@ protected function setUpRoutes($app)
5155
abort($responseCode);
5256
});
5357
}
58+
59+
/**
60+
* Assert whether the client was redirected to a given URI.
61+
*
62+
* @param string $uri
63+
* @param array $with
64+
* @return $this
65+
*/
66+
public function assertRedirectedTo($uri, $with = [])
67+
{
68+
PHPUnit::assertInstanceOf('Illuminate\Http\RedirectResponse', $this->response);
69+
70+
PHPUnit::assertEquals($this->app['url']->to($uri), $this->response->headers->get('Location'));
71+
72+
return $this;
73+
}
5474
}

0 commit comments

Comments
 (0)