Skip to content

Commit fe40d94

Browse files
committed
test: add test for forceGlobalSecureRequests
1 parent 37ebc6f commit fe40d94

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/system/Test/FeatureTestTraitTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
use CodeIgniter\Events\Events;
1616
use CodeIgniter\Exceptions\PageNotFoundException;
1717
use CodeIgniter\HTTP\Response;
18+
use CodeIgniter\Test\Mock\MockCodeIgniter;
19+
use Config\App;
1820
use Config\Routing;
1921
use Config\Services;
2022

@@ -629,4 +631,19 @@ public function testAutoRoutingLegacy()
629631

630632
$response->assertOK();
631633
}
634+
635+
public function testForceGlobalSecureRequests()
636+
{
637+
$config = config(App::class);
638+
$config->forceGlobalSecureRequests = true;
639+
Factories::injectMock('config', App::class, $config);
640+
641+
$this->app = new MockCodeIgniter($config);
642+
$this->app->initialize();
643+
644+
$response = $this->get('/');
645+
646+
// Do not redirect.
647+
$response->assertStatus(200);
648+
}
632649
}

0 commit comments

Comments
 (0)