1
0
Fork 0

Added test for 'dump' method of ClassMapGenerator class

pull/5532/head
Vyacheslav Pavlov 2016-07-20 23:33:37 +03:00
parent 3d920f8dbb
commit 03995d6caa
1 changed files with 14 additions and 0 deletions

View File

@ -218,6 +218,20 @@ class ClassMapGeneratorTest extends TestCase
ClassMapGenerator::createMap(__DIR__.'/no-file.no-foler'); 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) protected function assertEqualsNormalized($expected, $actual, $message = null)
{ {
foreach ($expected as $ns => $path) { foreach ($expected as $ns => $path) {