public function ClassCollectionLoaderTest::testTraitDependencies in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php \Symfony\Component\ClassLoader\Tests\ClassCollectionLoaderTest::testTraitDependencies()
File
- vendor/
symfony/ class-loader/ Tests/ ClassCollectionLoaderTest.php, line 23
Class
Namespace
Symfony\Component\ClassLoader\TestsCode
public function testTraitDependencies() {
if (PHP_VERSION_ID < 50400) {
$this
->markTestSkipped('Requires PHP > 5.4');
return;
}
require_once __DIR__ . '/Fixtures/deps/traits.php';
$r = new \ReflectionClass('Symfony\\Component\\ClassLoader\\ClassCollectionLoader');
$m = $r
->getMethod('getOrderedClasses');
$m
->setAccessible(true);
$ordered = $m
->invoke('Symfony\\Component\\ClassLoader\\ClassCollectionLoader', array(
'CTFoo',
));
$this
->assertEquals(array(
'TD',
'TC',
'TB',
'TA',
'TZ',
'CTFoo',
), array_map(function ($class) {
return $class
->getName();
}, $ordered));
$ordered = $m
->invoke('Symfony\\Component\\ClassLoader\\ClassCollectionLoader', array(
'CTBar',
));
$this
->assertEquals(array(
'TD',
'TZ',
'TC',
'TB',
'TA',
'CTBar',
), array_map(function ($class) {
return $class
->getName();
}, $ordered));
}