2009-02-17 22:30:13 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\Common;
|
|
|
|
|
2010-03-24 16:22:49 +00:00
|
|
|
use Doctrine\Common\ClassLoader;
|
2009-02-17 22:30:13 +00:00
|
|
|
|
2009-06-15 18:25:47 +00:00
|
|
|
require_once __DIR__ . '/../TestInit.php';
|
|
|
|
|
2009-02-17 22:30:13 +00:00
|
|
|
class ClassLoaderTest extends \Doctrine\Tests\DoctrineTestCase
|
|
|
|
{
|
2010-03-24 16:22:49 +00:00
|
|
|
public function testClassLoader()
|
2009-02-17 22:30:13 +00:00
|
|
|
{
|
2010-03-24 16:22:49 +00:00
|
|
|
$classLoader = new ClassLoader('ClassLoaderTest');
|
|
|
|
$classLoader->setIncludePath(__DIR__);
|
2009-09-11 19:50:48 +00:00
|
|
|
$classLoader->setFileExtension('.class.php');
|
2009-07-14 22:36:09 +00:00
|
|
|
$classLoader->setNamespaceSeparator('_');
|
|
|
|
|
2009-09-11 19:50:48 +00:00
|
|
|
$this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassA'), true);
|
2010-03-24 16:22:49 +00:00
|
|
|
$this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassB'), true);
|
2009-07-14 22:36:09 +00:00
|
|
|
$this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassC'), true);
|
2010-03-24 16:22:49 +00:00
|
|
|
}
|
2009-02-17 22:30:13 +00:00
|
|
|
}
|