Commit 813cd0d3 authored by Taylor Otwell's avatar Taylor Otwell

finish autoloader tests.

parent 319964fc
......@@ -71,4 +71,32 @@ class AutoloaderTest extends PHPUnit_Framework_TestCase {
$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
<?php namespace Dashboard;
/**
* This class is used for testing the auto-loading of classes
* that are mapped by namesapce.
*/
class Repository {}
\ No newline at end of file
<?php
class Autoloader_HardCoded {}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment