/** * Run script * */ public function run() { $mapDirs = array(BP . '/app/code/local', BP . '/app/code/community', BP . '/app/code/core', BP . '/lib'); ClassMapGenerator::dump($mapDirs, BP . '/includes/optimized_map.php'); }
public function testDump() { $tempDir = self::getUniqueTmpDirectory(); $resultFile = $tempDir . '/result.txt'; $fileInDirectory = $tempDir . DIRECTORY_SEPARATOR . 'TestClass.php'; file_put_contents($fileInDirectory, "<?php class TestClass {} ?>"); ClassMapGenerator::dump(array($tempDir), $resultFile); $fileInDirectory = str_replace('\\', '\\\\', $fileInDirectory); $this->assertEquals("<?php return array (\n 'TestClass' => '{$fileInDirectory}',\n);", file_get_contents($resultFile)); $fs = new Filesystem(); $fs->removeDirectory($tempDir); }