Skip to content

Commit 40fc368

Browse files
committed
test: update test code for config changes
1 parent 5dd958e commit 40fc368

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/system/Test/FeatureTestTraitTest.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use CodeIgniter\HTTP\Response;
2121
use CodeIgniter\Test\Mock\MockCodeIgniter;
2222
use Config\App;
23+
use Config\Feature;
2324
use Config\Routing;
2425
use Config\Services;
2526
use PHPUnit\Framework\Attributes\DataProvider;
@@ -359,17 +360,19 @@ public static function provideOpenCliRoutesFromHttpGot404(): iterable
359360
];
360361
}
361362

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+
367369
#[DataProvider('provideOpenCliRoutesFromHttpGot404')]
368-
public function testOpenCliRoutesFromHttpGot404($from, $to, $httpGet): void
370+
public function testOpenCliRoutesFromHttpGot404(string $from, string $to, string $httpGet): void
369371
{
370372
$this->expectException(PageNotFoundException::class);
371373
$this->expectExceptionMessage('Cannot access CLI Route: ');
372374

375+
$this->disableAutoRoutesImproved();
373376
$collection = Services::routes();
374377
$collection->setAutoRoute(true);
375378
$collection->setDefaultNamespace('Tests\Support\Controllers');
@@ -641,6 +644,7 @@ public function testSetupRequestBodyWithBody(): void
641644

642645
public function testAutoRoutingLegacy(): void
643646
{
647+
$this->disableAutoRoutesImproved();
644648
$config = config(Routing::class);
645649
$config->autoRoute = true;
646650
Factories::injectMock('config', Routing::class, $config);

0 commit comments

Comments
 (0)