File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 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 ,
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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments