Skip to content

Commit

Permalink
minor #19710 [ClassLoader] Fix tests (nicolas-grekas)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.7 branch.

Discussion
----------

[ClassLoader] Fix tests

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Tests pass?   | yes
| License       | MIT

As discussed right now on php-internals, this string is ignored and the docs only tells about null.

Commits
-------

0f95708 [ClassLoader] Fix tests
  • Loading branch information
nicolas-grekas committed Aug 23, 2016
2 parents 2449a97 + 0f95708 commit 5e5e1db
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -31,14 +31,14 @@ public function testTraitDependencies()
$m = $r->getMethod('getOrderedClasses');
$m->setAccessible(true);

$ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', array('CTFoo'));
$ordered = $m->invoke(null, 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'));
$ordered = $m->invoke(null, array('CTBar'));

$this->assertEquals(
array('TD', 'TZ', 'TC', 'TB', 'TA', 'CTBar'),
Expand All @@ -62,7 +62,7 @@ public function testClassReordering(array $classes)
$m = $r->getMethod('getOrderedClasses');
$m->setAccessible(true);

$ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes);
$ordered = $m->invoke(null, $classes);

$this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
}
Expand Down Expand Up @@ -120,7 +120,7 @@ public function testClassWithTraitsReordering(array $classes)
$m = $r->getMethod('getOrderedClasses');
$m->setAccessible(true);

$ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes);
$ordered = $m->invoke(null, $classes);

$this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
}
Expand Down Expand Up @@ -162,7 +162,7 @@ public function testFixClassWithTraitsOrdering()
$m = $r->getMethod('getOrderedClasses');
$m->setAccessible(true);

$ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes);
$ordered = $m->invoke(null, $classes);

$this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
}
Expand Down

0 comments on commit 5e5e1db

Please sign in to comment.