You are here

public function DebugClassLoaderTest::testIdempotence in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/debug/Tests/DebugClassLoaderTest.php \Symfony\Component\Debug\Tests\DebugClassLoaderTest::testIdempotence()

File

vendor/symfony/debug/Tests/DebugClassLoaderTest.php, line 42

Class

DebugClassLoaderTest

Namespace

Symfony\Component\Debug\Tests

Code

public function testIdempotence() {
  DebugClassLoader::enable();
  $functions = spl_autoload_functions();
  foreach ($functions as $function) {
    if (is_array($function) && $function[0] instanceof DebugClassLoader) {
      $reflClass = new \ReflectionClass($function[0]);
      $reflProp = $reflClass
        ->getProperty('classLoader');
      $reflProp
        ->setAccessible(true);
      $this
        ->assertNotInstanceOf('Symfony\\Component\\Debug\\DebugClassLoader', $reflProp
        ->getValue($function[0]));
      return;
    }
  }
  $this
    ->fail('DebugClassLoader did not register');
}