|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * This file is part of CodeIgniter 4 framework. |
| 5 | + * |
| 6 | + * (c) CodeIgniter Foundation <[email protected]> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view |
| 9 | + * the LICENSE file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +namespace CodeIgniter\Autoloader; |
| 13 | + |
| 14 | +use CodeIgniter\Cache\FactoriesCache\FileVarExportHandler; |
| 15 | +use Config\Autoload; |
| 16 | +use Config\Modules; |
| 17 | + |
| 18 | +/** |
| 19 | + * @internal |
| 20 | + * |
| 21 | + * @group Others |
| 22 | + */ |
| 23 | +final class FileLocatorCachedTest extends FileLocatorTest |
| 24 | +{ |
| 25 | + private FileLocator $locator; |
| 26 | + |
| 27 | + protected function setUp(): void |
| 28 | + { |
| 29 | + parent::setUp(); |
| 30 | + |
| 31 | + $autoloader = new Autoloader(); |
| 32 | + $autoloader->initialize(new Autoload(), new Modules()); |
| 33 | + $autoloader->addNamespace([ |
| 34 | + 'Unknown' => '/i/do/not/exist', |
| 35 | + 'Tests/Support' => TESTPATH . '_support/', |
| 36 | + 'App' => APPPATH, |
| 37 | + 'CodeIgniter' => [ |
| 38 | + TESTPATH, |
| 39 | + SYSTEMPATH, |
| 40 | + ], |
| 41 | + 'Errors' => APPPATH . 'Views/errors', |
| 42 | + 'System' => SUPPORTPATH . 'Autoloader/system', |
| 43 | + 'CodeIgniter\\Devkit' => [ |
| 44 | + TESTPATH . '_support/', |
| 45 | + ], |
| 46 | + 'Acme\SampleProject' => TESTPATH . '_support', |
| 47 | + 'Acme\Sample' => TESTPATH . '_support/does/not/exists', |
| 48 | + ]); |
| 49 | + |
| 50 | + $this->handler = new FileVarExportHandler(); |
| 51 | + $fileLocator = new FileLocator($autoloader); |
| 52 | + $this->locator = new FileLocatorCached($fileLocator, $this->handler); |
| 53 | + } |
| 54 | +} |
0 commit comments