function ClassFinderTest::testPrefixes in X Autoload 7.3
File
- tests/
Drupal/ xautoload/ Tests/ ClassFinderTest.php, line 30
Class
Namespace
Drupal\xautoload\TestsCode
function testPrefixes() {
// Prepare the class finder.
$finder = new \xautoload_ClassFinder_NamespaceOrPrefix();
$finder
->registerPrefixDeep('ex_ample', 'sites/all/modules/contrib/ex_ample/lib');
$finder
->registerPrefixRoot('ex_ample', 'sites/all/modules/contrib/ex_ample/vendor');
// Test class finding for 'ex_ample_Abc_Def'.
$this
->assertFinderSuggestions($finder, 'ex_ample_Abc_Def', array(
// Class finder is expected to suggest these files, in the exact order,
// until one of them is accepted.
'sites/all/modules/contrib/ex_ample/lib/Abc/Def.php',
'sites/all/modules/contrib/ex_ample/vendor/ex/ample/Abc/Def.php',
));
}