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