diff --git a/tests/cases/laravel/autoloader.test.php b/tests/cases/laravel/autoloader.test.php index 9aafa330..7d860b32 100644 --- a/tests/cases/laravel/autoloader.test.php +++ b/tests/cases/laravel/autoloader.test.php @@ -71,4 +71,32 @@ public function testPsrLibrariesAndModelsCanBeLoaded() $this->assertInstanceOf('Repositories\\User', new Repositories\User); } + /** + * Test the loading of hard-coded classes. + * + * @group laravel + */ + public function testHardcodedClassesCanBeLoaded() + { + Autoloader::map(array( + 'Autoloader_HardCoded' => APP_PATH.'models'.DS.'autoloader.php', + )); + + $this->assertInstanceOf('Autoloader_HardCoded', new Autoloader_HardCoded); + } + + /** + * Test the loading of classes mapped by namespaces. + * + * @group laravel + */ + public function testClassesMappedByNamespaceCanBeLoaded() + { + Autoloader::namespaces(array( + 'Dashboard' => APP_PATH.'dashboard', + )); + + $this->assertInstanceOf('Dashboard\\Repository', new Dashboard\Repository); + } + } \ No newline at end of file diff --git a/tests/laravel/dashboard/repository.php b/tests/laravel/dashboard/repository.php new file mode 100644 index 00000000..7f6b3a7f --- /dev/null +++ b/tests/laravel/dashboard/repository.php @@ -0,0 +1,7 @@ +