|
9 | 9 | use Psr\Http\Message\ResponseInterface; |
10 | 10 | use Psr\Http\Message\ServerRequestInterface; |
11 | 11 | use Zend\Diactoros\Uri; |
| 12 | +use Zend\Expressive\Router\Route; |
12 | 13 | use Zend\Expressive\Router\RouterInterface; |
13 | 14 | use Zend\Expressive\Router\RouteResult; |
14 | 15 |
|
|
69 | 70 | it('not redirect on https and match but no strict_transport_security config', function () { |
70 | 71 |
|
71 | 72 | Console::overrideIsConsole(false); |
72 | | - $match = RouteResult::fromRouteMatch('about', 'About', []); |
| 73 | + $match = RouteResult::fromRoute(new Route('/about', 'About')); |
73 | 74 | allow($this->router)->toReceive('match')->andReturn($match); |
74 | 75 |
|
75 | 76 | allow($this->request)->toReceive('getUri', 'getScheme')->andReturn('https'); |
|
85 | 86 | it('not redirect on http and match, with force_all_routes is false and matched route name not in force_specific_routes config', function () { |
86 | 87 |
|
87 | 88 | Console::overrideIsConsole(false); |
88 | | - $match = RouteResult::fromRouteMatch('about', 'About', []); |
| 89 | + $match = RouteResult::fromRoute(new Route('/about', 'About')); |
89 | 90 | allow($this->router)->toReceive('match')->andReturn($match); |
90 | 91 |
|
91 | 92 | allow($this->request)->toReceive('getUri', 'getScheme')->andReturn('http'); |
|
112 | 113 | it('not redirect on https and match, with strict_transport_security config, but disabled', function () { |
113 | 114 |
|
114 | 115 | Console::overrideIsConsole(false); |
115 | | - $match = RouteResult::fromRouteMatch('about', 'About', []); |
| 116 | + $match = RouteResult::fromRoute(new Route('/about', 'About')); |
116 | 117 | allow($this->router)->toReceive('match')->andReturn($match); |
117 | 118 |
|
118 | 119 | allow($this->request)->toReceive('getUri', 'getScheme')->andReturn('https'); |
|
138 | 139 | it('not redirect on https and match, with strict_transport_security config, and enabled', function () { |
139 | 140 |
|
140 | 141 | Console::overrideIsConsole(false); |
141 | | - $match = RouteResult::fromRouteMatch('about', 'About', []); |
| 142 | + $match = RouteResult::fromRoute(new Route('/about', 'About')); |
142 | 143 |
|
143 | 144 | allow($this->router)->toReceive('match')->andReturn($match); |
144 | 145 | allow($this->request)->toReceive('getUri', 'getScheme')->andReturn('https'); |
|
164 | 165 | it('return Response with 308 status on http and match', function () { |
165 | 166 |
|
166 | 167 | Console::overrideIsConsole(false); |
167 | | - $match = RouteResult::fromRouteMatch('about', 'About', []); |
| 168 | + $match = RouteResult::fromRoute(new Route('/about', 'About')); |
168 | 169 |
|
169 | 170 | allow($this->router)->toReceive('match')->andReturn($match); |
170 | 171 | allow($this->request)->toReceive('getUri', 'getScheme')->andReturn('http'); |
|
0 commit comments