protected function ClassLoaderTest::assertCandidateOrder in X Autoload 7.4
Same name and namespace in other branches
- 7.5 tests/src/ClassLoaderTest.php \Drupal\xautoload\Tests\ClassLoaderTest::assertCandidateOrder()
Parameters
\Drupal\xautoload\ClassLoader\ClassLoaderInterface $loader:
string $classTemplate:
string[] $expectedCandidateTemplates:
4 calls to ClassLoaderTest::assertCandidateOrder()
- ClassLoaderTest::testNamespaces in tests/
lib/ ClassLoaderTest.php - Test PSR-0-like namespaces.
- ClassLoaderTest::testPrefixes in tests/
lib/ ClassLoaderTest.php - Test PEAR-like prefixes.
- ClassLoaderTest::testPsr4 in tests/
lib/ ClassLoaderTest.php - Test PSR-4-like namespaces.
- ClassLoaderTest::testSpecialUnderscores in tests/
lib/ ClassLoaderTest.php - Tests PEAR-like class names beginning with underscore, or with a double underscore in between.
File
- tests/
lib/ ClassLoaderTest.php, line 129
Class
Namespace
Drupal\xautoload\TestsCode
protected function assertCandidateOrder($loader, $classTemplate, array $expectedCandidateTemplates) {
for ($i = 0; $i < count($expectedCandidateTemplates); ++$i) {
$class = $this
->replaceWildcard($classTemplate, "n{$i}");
// If str_replace() is called with an array as 3rd parameter, it will do
// the replacement on all array elements.
$expectedCandidates = $this
->replaceWildcardMultiple(array_slice($expectedCandidateTemplates, 0, $i + 1), "n{$i}");
$this
->assertFileInclusions($loader, $class, $expectedCandidates);
}
}