Skip to content

Commit b6be728

Browse files
committed
test fix
1 parent 7e2f431 commit b6be728

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

spec/Listener/ForceHttpsSpec.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242

243243
});
244244

245-
it('redirect with www prefix for already has www prefix with configurable "remove_www_prefix" on force_all_routes', function () {
245+
it('redirect without www prefix for already has www prefix with configurable "remove_www_prefix" on force_all_routes', function () {
246246

247247
$listener = new ForceHttps([
248248
'enable' => true,
@@ -264,6 +264,9 @@
264264
allow($this->uri)->toReceive('setScheme')->with('https')->andReturn($this->uri);
265265
allow($this->uri)->toReceive('toString')->andReturn('https://www.example.com/about');
266266
allow($this->mvcEvent)->toReceive('getResponse')->andReturn($this->response);
267+
allow($this->response)->toReceive('getHeaders', 'addHeaderLine')
268+
->with('Location', 'https://example.com/about')
269+
->andReturn($this->response);
267270
allow($this->response)->toReceive('setStatusCode')->with(308)->andReturn($this->response);
268271
allow($this->response)->toReceive('send');
269272

spec/Middleware/ForceHttpsSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
allow($this->request)->toReceive('getUri', '__toString')->andReturn('http://www.example.com/about');
261261
allow($this->router)->toReceive('match')->andReturn($match);
262262
allow($this->request)->toReceive('getUri', 'getScheme')->andReturn('http');
263-
allow($this->request)->toReceive('getUri', 'withScheme', '__toString')->andReturn('https://example.com/about');
263+
allow($this->request)->toReceive('getUri', 'withScheme', '__toString')->andReturn('https://www.example.com/about');
264264

265265
allow($this->response)->toReceive('withStatus')->andReturn($this->response);
266266

0 commit comments

Comments
 (0)