Permalink
Browse files

Fixed test to use Reflection

  • Loading branch information...
1 parent 4288c63 commit 05639e1018839cfa5543c50dc6827e92af36319c @merk merk committed Mar 8, 2013
Showing with 5 additions and 6 deletions.
  1. +0 −5 DebugClassLoader.php
  2. +5 −1 Tests/DebugClassLoaderTest.php
View
@@ -104,9 +104,4 @@ public function loadClass($class)
return true;
}
}
-
- public function getClassFinder()
- {
- return $this->classFinder;
- }
}
@@ -37,7 +37,11 @@ public function testIdempotence()
$functions = spl_autoload_functions();
foreach ($functions as $function) {
if (is_array($function) && $function[0] instanceof DebugClassLoader) {
- $this->assertNotInstanceOf('Symfony\Component\ClassLoader\DebugClassLoader', $function[0]->getClassFinder());
+ $reflClass = new \ReflectionClass($function[0]);
+ $reflProp = $reflClass->getProperty('classFinder');
+ $reflProp->setAccessible(true);
+
+ $this->assertNotInstanceOf('Symfony\Component\ClassLoader\DebugClassLoader', $reflProp->getValue($function[0]));
return;
}
}

0 comments on commit 05639e1

Please sign in to comment.