You are here

public function ClassLoaderTest::testClassExistsWhenLoaderIsProtected 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::testClassExistsWhenLoaderIsProtected()

File

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