You are here

public function ClassLoaderTest::testClassLoader in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php \Doctrine\Tests\Common\ClassLoaderTest::testClassLoader()

File

vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php, line 9

Class

ClassLoaderTest

Namespace

Doctrine\Tests\Common

Code

public function testClassLoader() {
  $classLoader = new ClassLoader('ClassLoaderTest');
  $classLoader
    ->setIncludePath(__DIR__);
  $classLoader
    ->setFileExtension('.class.php');
  $classLoader
    ->setNamespaceSeparator('_');
  $this
    ->assertTrue($classLoader
    ->canLoadClass('ClassLoaderTest_ClassA'));
  $this
    ->assertTrue($classLoader
    ->canLoadClass('ClassLoaderTest_ClassB'));
  $this
    ->assertTrue($classLoader
    ->canLoadClass('ClassLoaderTest_ClassC'));
  $this
    ->assertFalse($classLoader
    ->canLoadClass('OtherClass'));
  $this
    ->assertEquals($classLoader
    ->loadClass('ClassLoaderTest_ClassA'), true);
  $this
    ->assertEquals($classLoader
    ->loadClass('ClassLoaderTest_ClassB'), true);
  $this
    ->assertEquals($classLoader
    ->loadClass('ClassLoaderTest_ClassC'), true);
}