mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
[ClassMapGenerator] Improve error message when the path does not exist
i.e. the composer.json has a typo
This commit is contained in:
parent
ff5c428d60
commit
ab48114531
2 changed files with 29 additions and 13 deletions
|
@ -88,7 +88,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
|
|||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Could not scan for classes inside
|
||||
*/
|
||||
public function testThrowsWhenFileDoesNotExist()
|
||||
public function testFindClassesThrowsWhenFileDoesNotExist()
|
||||
{
|
||||
$r = new \ReflectionClass('Composer\\Autoload\\ClassMapGenerator');
|
||||
$find = $r->getMethod('findClasses');
|
||||
|
@ -97,6 +97,15 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
|
|||
$find->invoke(null, __DIR__.'/no-file');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Could not scan for classes inside
|
||||
*/
|
||||
public function testCreateMapThrowsWhenDirectoryDoesNotExist()
|
||||
{
|
||||
ClassMapGenerator::createMap(__DIR__.'/no-file.no-foler');
|
||||
}
|
||||
|
||||
protected function assertEqualsNormalized($expected, $actual, $message = null)
|
||||
{
|
||||
foreach ($expected as $ns => $path) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue