|
19 | 19 | use CodeIgniter\Exceptions\PageNotFoundException; |
20 | 20 | use CodeIgniter\HTTP\Method; |
21 | 21 | use CodeIgniter\HTTP\Response; |
22 | | -use CodeIgniter\Router\Exceptions\RedirectException; |
23 | 22 | use CodeIgniter\Router\RouteCollection; |
24 | 23 | use CodeIgniter\Test\CIUnitTestCase; |
25 | 24 | use CodeIgniter\Test\Filters\CITestStreamFilter; |
@@ -600,29 +599,6 @@ public function testRunRedirectionWithPOSTAndHTTPCode301(): void |
600 | 599 | $this->assertSame(301, $response->getStatusCode()); |
601 | 600 | } |
602 | 601 |
|
603 | | - /** |
604 | | - * test for deprecated \CodeIgniter\Router\Exceptions\RedirectException for backward compatibility |
605 | | - */ |
606 | | - public function testRedirectExceptionDeprecated(): void |
607 | | - { |
608 | | - $_SERVER['argv'] = ['index.php', '/']; |
609 | | - $_SERVER['argc'] = 2; |
610 | | - |
611 | | - // Inject mock router. |
612 | | - $routes = service('routes'); |
613 | | - $routes->get('/', static function (): never { |
614 | | - throw new RedirectException('redirect-exception', 503); |
615 | | - }); |
616 | | - |
617 | | - $router = service('router', $routes, service('incomingrequest')); |
618 | | - Services::injectMock('router', $router); |
619 | | - |
620 | | - $response = $this->codeigniter->run($routes, true); |
621 | | - |
622 | | - $this->assertSame(503, $response->getStatusCode()); |
623 | | - $this->assertSame('http://example.com/redirect-exception', $response->getHeaderLine('Location')); |
624 | | - } |
625 | | - |
626 | 602 | public function testStoresPreviousURL(): void |
627 | 603 | { |
628 | 604 | $_SERVER['argv'] = ['index.php', '/']; |
|
0 commit comments