1
0
mirror of https://github.com/danog/class-finder.git synced 2025-01-23 06:11:26 +01:00

Add test covering that entirely unknown namespaces throw an exception.

This commit is contained in:
Hayden Pierce 2018-09-08 21:02:23 -05:00
parent aa77f1f042
commit f21e20df18

View File

@ -112,6 +112,15 @@ class ClassFinderTest extends \PHPUnit_Framework_TestCase
ClassFinder::getClassesInNamespace('TestApp1\DoesNotExist');
}
/**
* @expectedException HaydenPierce\ClassFinder\Exception\ClassFinderException
* @expectedExceptionMessageRegExp /Unknown namespace 'DoesNotExist'\./
*/
public function testThrowsOnUnknownNameSpace()
{
ClassFinder::getClassesInNamespace('DoesNotExist');
}
/**
* @expectedException HaydenPierce\ClassFinder\Exception\ClassFinderException
* @expectedExceptionMessage Could not locate composer.json. You can get around this by setting ClassFinder::$appRoot manually.