mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Added test for 'dump' method of ClassMapGenerator class
This commit is contained in:
parent
3d920f8dbb
commit
03995d6caa
1 changed files with 14 additions and 0 deletions
|
@ -218,6 +218,20 @@ class ClassMapGeneratorTest extends TestCase
|
|||
ClassMapGenerator::createMap(__DIR__.'/no-file.no-foler');
|
||||
}
|
||||
|
||||
public function testDump()
|
||||
{
|
||||
$dir = self::getUniqueTmpDirectory();
|
||||
|
||||
$resultFile = 'result.txt';
|
||||
$fileInDirectory = $dir . '/TestClass.php';
|
||||
|
||||
file_put_contents($fileInDirectory, "<?php class TestClass {} ?>");
|
||||
|
||||
ClassMapGenerator::dump(array($dir), $resultFile);
|
||||
|
||||
$this->assertEquals("<?php return array (\n 'TestClass' => '$fileInDirectory',\n);", file_get_contents($resultFile));
|
||||
}
|
||||
|
||||
protected function assertEqualsNormalized($expected, $actual, $message = null)
|
||||
{
|
||||
foreach ($expected as $ns => $path) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue