diff --git a/tests/system/Autoloader/FileLocatorCachedTest.php b/tests/system/Autoloader/FileLocatorCachedTest.php new file mode 100644 index 000000000000..4f8a8b2e2b23 --- /dev/null +++ b/tests/system/Autoloader/FileLocatorCachedTest.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace CodeIgniter\Autoloader; + +use CodeIgniter\Cache\FactoriesCache\FileVarExportHandler; +use Config\Autoload; +use Config\Modules; + +/** + * @internal + * + * @group Others + */ +final class FileLocatorCachedTest extends FileLocatorTest +{ + private FileVarExportHandler $handler; + protected FileLocator $locator; + + protected function setUp(): void + { + parent::setUp(); + + $autoloader = new Autoloader(); + $autoloader->initialize(new Autoload(), new Modules()); + $autoloader->addNamespace([ + 'Unknown' => '/i/do/not/exist', + 'Tests/Support' => TESTPATH . '_support/', + 'App' => APPPATH, + 'CodeIgniter' => [ + TESTPATH, + SYSTEMPATH, + ], + 'Errors' => APPPATH . 'Views/errors', + 'System' => SUPPORTPATH . 'Autoloader/system', + 'CodeIgniter\\Devkit' => [ + TESTPATH . '_support/', + ], + 'Acme\SampleProject' => TESTPATH . '_support', + 'Acme\Sample' => TESTPATH . '_support/does/not/exists', + ]); + + $this->handler = new FileVarExportHandler(); + $fileLocator = new FileLocator($autoloader); + $this->locator = new FileLocatorCached($fileLocator, $this->handler); + } +} diff --git a/tests/system/Autoloader/FileLocatorTest.php b/tests/system/Autoloader/FileLocatorTest.php index 1cf32cfa5ad1..4fa37e32a28f 100644 --- a/tests/system/Autoloader/FileLocatorTest.php +++ b/tests/system/Autoloader/FileLocatorTest.php @@ -20,10 +20,11 @@ * @internal * * @group Others + * @no-final */ -final class FileLocatorTest extends CIUnitTestCase +class FileLocatorTest extends CIUnitTestCase { - private FileLocator $locator; + protected FileLocator $locator; protected function setUp(): void {