|
20 | 20 | use CodeIgniter\HTTP\Response; |
21 | 21 | use CodeIgniter\Test\Mock\MockCodeIgniter; |
22 | 22 | use Config\App; |
| 23 | +use Config\Feature; |
23 | 24 | use Config\Routing; |
24 | 25 | use Config\Services; |
25 | 26 | use PHPUnit\Framework\Attributes\DataProvider; |
@@ -359,17 +360,19 @@ public static function provideOpenCliRoutesFromHttpGot404(): iterable |
359 | 360 | ]; |
360 | 361 | } |
361 | 362 |
|
362 | | - /** |
363 | | - * @param mixed $from |
364 | | - * @param mixed $to |
365 | | - * @param mixed $httpGet |
366 | | - */ |
| 363 | + private function disableAutoRoutesImproved(): void |
| 364 | + { |
| 365 | + $featureConfig = config(Feature::class); |
| 366 | + $featureConfig->autoRoutesImproved = false; |
| 367 | + } |
| 368 | + |
367 | 369 | #[DataProvider('provideOpenCliRoutesFromHttpGot404')] |
368 | | - public function testOpenCliRoutesFromHttpGot404($from, $to, $httpGet): void |
| 370 | + public function testOpenCliRoutesFromHttpGot404(string $from, string $to, string $httpGet): void |
369 | 371 | { |
370 | 372 | $this->expectException(PageNotFoundException::class); |
371 | 373 | $this->expectExceptionMessage('Cannot access CLI Route: '); |
372 | 374 |
|
| 375 | + $this->disableAutoRoutesImproved(); |
373 | 376 | $collection = Services::routes(); |
374 | 377 | $collection->setAutoRoute(true); |
375 | 378 | $collection->setDefaultNamespace('Tests\Support\Controllers'); |
@@ -641,6 +644,7 @@ public function testSetupRequestBodyWithBody(): void |
641 | 644 |
|
642 | 645 | public function testAutoRoutingLegacy(): void |
643 | 646 | { |
| 647 | + $this->disableAutoRoutesImproved(); |
644 | 648 | $config = config(Routing::class); |
645 | 649 | $config->autoRoute = true; |
646 | 650 | Factories::injectMock('config', Routing::class, $config); |
|
0 commit comments