You are here

public function ClassLoaderTest::testClassExists in Zircon Profile 8.0

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

File

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

Class

ClassLoaderTest

Namespace

Doctrine\Tests\Common

Code

public function testClassExists() {
  $this
    ->assertFalse(ClassLoader::classExists('ClassLoaderTest\\ClassD'));
  $badLoader = function ($className) {
    require __DIR__ . '/ClassLoaderTest/ClassD.php';
    return true;
  };
  spl_autoload_register($badLoader);
  $this
    ->assertTrue(ClassLoader::classExists('ClassLoaderTest\\ClassD'));
  spl_autoload_unregister($badLoader);
}