protected function XAutoloadUnitTestCase::assertFinderSuggestions in X Autoload 7.5
Same name and namespace in other branches
- 7.3 lib/Drupal/xautoload/Tests/XAutoloadUnitTestCase.php \Drupal\xautoload\Tests\XAutoloadUnitTestCase::assertFinderSuggestions()
- 7.4 lib/Drupal/xautoload/Tests/XAutoloadUnitTestCase.php \Drupal\xautoload\Tests\XAutoloadUnitTestCase::assertFinderSuggestions()
Parameters
ClassFinder $finder:
string $class:
array $expectedSuggestions:
Return value
bool Result of the assertion
2 calls to XAutoloadUnitTestCase::assertFinderSuggestions()
- XAutoloadUnitTestCase::testNamespaces in lib/
Drupal/ xautoload/ Tests/ XAutoloadUnitTestCase.php - XAutoloadUnitTestCase::testPrefixes in lib/
Drupal/ xautoload/ Tests/ XAutoloadUnitTestCase.php
File
- lib/
Drupal/ xautoload/ Tests/ XAutoloadUnitTestCase.php, line 103
Class
Namespace
Drupal\xautoload\TestsCode
protected function assertFinderSuggestions($finder, $class, array $expectedSuggestions) {
$success = TRUE;
for ($iAccept = 0; $iAccept < count($expectedSuggestions); ++$iAccept) {
list($method_name, $file) = $expectedSuggestions[$iAccept];
$api = new CollectFilesInjectedApi($class, $method_name, $file);
$finder
->apiFindFile($api, $class);
$suggestions = $api
->getSuggestions();
$expected = array_slice($expectedSuggestions, 0, $iAccept + 1);
$success = $success && $this
->assertEqualBlock($expected, $suggestions, "Finder suggestions for class <code>{$class}</code>:");
}
return $success;
}