finish autoloader tests.
This commit is contained in:
parent
319964fce2
commit
813cd0d3b8
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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 {}
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
class Autoloader_HardCoded {}
|
Loading…
Reference in New Issue