Skip to content

Commit ab30e0e

Browse files
committed
test: fix failed tests
1 parent 83fc5b2 commit ab30e0e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tests/system/Commands/RoutesTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ final class RoutesTest extends CIUnitTestCase
2626

2727
protected function setUp(): void
2828
{
29+
$this->resetServices();
30+
2931
parent::setUp();
3032

3133
CITestStreamFilter::$buffer = '';
@@ -40,6 +42,8 @@ protected function setUp(): void
4042
protected function tearDown(): void
4143
{
4244
stream_filter_remove($this->streamFilter);
45+
46+
$this->resetServices();
4347
}
4448

4549
protected function getBuffer()
@@ -60,6 +64,7 @@ public function testRoutesCommand()
6064
public function testRoutesCommandRouteFilterAndAutoRoute()
6165
{
6266
$routes = Services::routes();
67+
$routes->setDefaultNamespace('App\Controllers');
6368
$routes->resetRoutes();
6469
$routes->get('/', 'Home::index', ['filter' => 'csrf']);
6570

tests/system/Commands/ScaffoldGeneratorTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
use CodeIgniter\Test\CIUnitTestCase;
1515
use CodeIgniter\Test\Filters\CITestStreamFilter;
16+
use Config\Autoload;
17+
use Config\Modules;
18+
use Config\Services;
1619

1720
/**
1821
* @internal
@@ -23,6 +26,9 @@ final class ScaffoldGeneratorTest extends CIUnitTestCase
2326

2427
protected function setUp(): void
2528
{
29+
$this->resetServices();
30+
Services::autoloader()->initialize(new Autoload(), new Modules());
31+
2632
CITestStreamFilter::$buffer = '';
2733

2834
$this->streamFilter = stream_filter_append(STDOUT, 'CITestStreamFilter');

0 commit comments

Comments
 (0)