finish autoloader tests.

This commit is contained in:
Taylor Otwell 2012-01-18 14:13:50 -06:00
parent 319964fce2
commit 813cd0d3b8
3 changed files with 38 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -0,0 +1,7 @@
<?php namespace Dashboard;
/**
* This class is used for testing the auto-loading of classes
* that are mapped by namesapce.
*/
class Repository {}

View File

@ -0,0 +1,3 @@
<?php
class Autoloader_HardCoded {}