You are here

public function ClassCollectionLoaderTest::testClassReordering in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php \Symfony\Component\ClassLoader\Tests\ClassCollectionLoaderTest::testClassReordering()

@dataProvider getDifferentOrders

File

vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php, line 55

Class

ClassCollectionLoaderTest

Namespace

Symfony\Component\ClassLoader\Tests

Code

public function testClassReordering(array $classes) {
  $expected = array(
    'ClassesWithParents\\GInterface',
    'ClassesWithParents\\CInterface',
    'ClassesWithParents\\B',
    'ClassesWithParents\\A',
  );
  $r = new \ReflectionClass('Symfony\\Component\\ClassLoader\\ClassCollectionLoader');
  $m = $r
    ->getMethod('getOrderedClasses');
  $m
    ->setAccessible(true);
  $ordered = $m
    ->invoke('Symfony\\Component\\ClassLoader\\ClassCollectionLoader', $classes);
  $this
    ->assertEquals($expected, array_map(function ($class) {
    return $class
      ->getName();
  }, $ordered));
}