|
12 | 12 | use Zend\Http\PhpEnvironment\Response; |
13 | 13 | use Zend\Mvc\Application; |
14 | 14 | use Zend\Mvc\MvcEvent; |
15 | | -use Zend\Mvc\SendResponseListener; |
16 | 15 | use Zend\Router\RouteMatch; |
17 | 16 | use Zend\Uri\Uri; |
18 | 17 |
|
|
76 | 75 |
|
77 | 76 | beforeEach(function () { |
78 | 77 | $this->mvcEvent = Double::instance(['extends' => MvcEvent::class, 'methods' => '__construct']); |
79 | | - $this->application = Double::instance(['extends' => Application::class, 'methods' => '__construct']); |
80 | | - $this->sendResponseListener = Double::instance(['extends' => SendResponseListener::class, 'methods' => '__construct']); |
81 | 78 | $this->response = Double::instance(['extends' => Response::class]); |
82 | 79 | $this->request = Double::instance(['extends' => Request::class]); |
83 | 80 | $this->uri = Double::instance(['extends' => Uri::class]); |
|
157 | 154 | allow($this->response)->toReceive('getHeaders', 'addHeaderLine')->with('Location', 'https://example.com/about'); |
158 | 155 | allow($this->response)->toReceive('send'); |
159 | 156 |
|
160 | | - allow($this->mvcEvent)->toReceive('getApplication')->andReturn($this->application); |
161 | | - allow($this->application)->toReceive('getEventManager')->andReturn($this->eventManager); |
162 | | - allow($this->application)->toReceive('getServiceManager', 'get') |
163 | | - ->with('SendResponseListener') |
164 | | - ->andReturn($this->sendResponseListener); |
165 | | - |
166 | 157 | $closure = function () use ($listener) { |
167 | 158 | $listener->forceHttpsScheme($this->mvcEvent); |
168 | 159 | }; |
|
198 | 189 | allow($this->response)->toReceive('getHeaders', 'addHeaderLine')->with('Location', 'https://example.com/about'); |
199 | 190 | allow($this->response)->toReceive('send'); |
200 | 191 |
|
201 | | - allow($this->mvcEvent)->toReceive('getApplication')->andReturn($this->application); |
202 | | - allow($this->application)->toReceive('getEventManager')->andReturn($this->eventManager); |
203 | | - allow($this->application)->toReceive('getServiceManager', 'get') |
204 | | - ->with('SendResponseListener') |
205 | | - ->andReturn($this->sendResponseListener); |
206 | | - |
207 | 192 | $closure = function () use ($listener) { |
208 | 193 | $listener->forceHttpsScheme($this->mvcEvent); |
209 | 194 | }; |
|
237 | 222 | allow($this->response)->toReceive('getHeaders', 'addHeaderLine')->with('Location', 'https://example.com/about'); |
238 | 223 | allow($this->response)->toReceive('send'); |
239 | 224 |
|
240 | | - allow($this->mvcEvent)->toReceive('getApplication')->andReturn($this->application); |
241 | | - allow($this->application)->toReceive('getEventManager')->andReturn($this->eventManager); |
242 | | - allow($this->application)->toReceive('getServiceManager', 'get') |
243 | | - ->with('SendResponseListener') |
244 | | - ->andReturn($this->sendResponseListener); |
245 | | - |
246 | 225 | $closure = function () use ($listener) { |
247 | 226 | $listener->forceHttpsScheme($this->mvcEvent); |
248 | 227 | }; |
|
278 | 257 | allow($this->response)->toReceive('getHeaders', 'addHeaderLine')->with('Location', 'https://example.com/about'); |
279 | 258 | allow($this->response)->toReceive('send'); |
280 | 259 |
|
281 | | - allow($this->mvcEvent)->toReceive('getApplication')->andReturn($this->application); |
282 | | - allow($this->application)->toReceive('getEventManager')->andReturn($this->eventManager); |
283 | | - allow($this->application)->toReceive('getServiceManager', 'get') |
284 | | - ->with('SendResponseListener') |
285 | | - ->andReturn($this->sendResponseListener); |
286 | | - |
287 | 260 | $closure = function () use ($listener) { |
288 | 261 | $listener->forceHttpsScheme($this->mvcEvent); |
289 | 262 | }; |
|
321 | 294 | ->with('Location', 'https://example.com/about') |
322 | 295 | ->andReturn($this->response); |
323 | 296 |
|
324 | | - allow($this->mvcEvent)->toReceive('getApplication')->andReturn($this->application); |
325 | | - allow($this->application)->toReceive('getEventManager')->andReturn($this->eventManager); |
326 | | - allow($this->application)->toReceive('getServiceManager', 'get') |
327 | | - ->with('SendResponseListener') |
328 | | - ->andReturn($this->sendResponseListener); |
329 | | - |
330 | 297 | allow($this->response)->toReceive('setStatusCode')->with(308)->andReturn($this->response); |
331 | 298 | allow($this->response)->toReceive('send'); |
332 | 299 |
|
|
0 commit comments