|
3 | 3 | use CodeIgniter\Session\Handlers\FileHandler; |
4 | 4 | use CodeIgniter\HTTP\Response; |
5 | 5 | use Config\App; |
6 | | -use Config\Autoload; |
7 | 6 | use CodeIgniter\Config\Services; |
8 | 7 | use CodeIgniter\Router\RouteCollection; |
9 | 8 | use CodeIgniter\HTTP\RedirectResponse; |
10 | 9 | use CodeIgniter\HTTP\URI; |
11 | 10 | use CodeIgniter\HTTP\UserAgent; |
12 | 11 | use Config\Logger; |
13 | | -use Tests\Support\Autoloader\MockFileLocator; |
14 | 12 | use Tests\Support\HTTP\MockIncomingRequest; |
15 | 13 | use Tests\Support\Log\TestLogger; |
16 | 14 | use Tests\Support\Session\MockSession; |
@@ -102,7 +100,9 @@ public function testRedirectReturnsRedirectResponse() |
102 | 100 | $_SERVER['REQUEST_METHOD'] = 'GET'; |
103 | 101 |
|
104 | 102 | $response = $this->createMock(\CodeIgniter\HTTP\Response::class); |
105 | | - $routes = new \CodeIgniter\Router\RouteCollection(new \Tests\Support\Autoloader\MockFileLocator(new \Config\Autoload()), new \Config\Modules()); |
| 103 | + $routes = new \CodeIgniter\Router\RouteCollection( |
| 104 | + Services::locator(), new \Config\Modules() |
| 105 | + ); |
106 | 106 | \CodeIgniter\Services::injectMock('response', $response); |
107 | 107 | \CodeIgniter\Services::injectMock('routes', $routes); |
108 | 108 |
|
@@ -267,7 +267,7 @@ public function testOldInput() |
267 | 267 | $this->config = new App(); |
268 | 268 | $this->config->baseURL = 'http://example.com'; |
269 | 269 |
|
270 | | - $this->routes = new RouteCollection(new MockFileLocator(new Autoload()), new \Config\Modules()); |
| 270 | + $this->routes = new RouteCollection(Services::locator(), new \Config\Modules()); |
271 | 271 | Services::injectMock('routes', $this->routes); |
272 | 272 |
|
273 | 273 | $this->request = new MockIncomingRequest($this->config, new URI('http://example.com'), null, new UserAgent()); |
@@ -303,7 +303,7 @@ public function testOldInputArray() |
303 | 303 | $this->config = new App(); |
304 | 304 | $this->config->baseURL = 'http://example.com'; |
305 | 305 |
|
306 | | - $this->routes = new RouteCollection(new MockFileLocator(new Autoload()), new \Config\Modules()); |
| 306 | + $this->routes = new RouteCollection(Services::locator(), new \Config\Modules()); |
307 | 307 | Services::injectMock('routes', $this->routes); |
308 | 308 |
|
309 | 309 | $this->request = new MockIncomingRequest($this->config, new URI('http://example.com'), null, new UserAgent()); |
|
0 commit comments