You are here

public function ClassLoaderTest::testClassExists in Plug 7

File

lib/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);
}