You are here

public function ClassLoaderTest::testClassExistsWhenLoaderIsProtected in Plug 7

File

lib/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php, line 65

Class

ClassLoaderTest

Namespace

Doctrine\Tests\Common

Code

public function testClassExistsWhenLoaderIsProtected() {
  require_once __DIR__ . '/ClassLoaderTest/ExternalLoader.php';

  // Test static call
  \ClassLoaderTest\ExternalLoader::registerStatic();
  $this
    ->assertFalse(ClassLoader::classExists('ClassLoaderTest\\Class\\That\\Does\\Not\\Exist'));
  \ClassLoaderTest\ExternalLoader::unregisterStatic();

  // Test object
  $loader = new \ClassLoaderTest\ExternalLoader();
  $loader
    ->register();
  $this
    ->assertFalse(ClassLoader::classExists('ClassLoaderTest\\Class\\That\\Does\\Not\\Exist'));
  $loader
    ->unregister();
}