function XAutoloadUnitTestCase::testNamespaces in X Autoload 7.4
Same name and namespace in other branches
- 7.5 lib/Drupal/xautoload/Tests/XAutoloadUnitTestCase.php \Drupal\xautoload\Tests\XAutoloadUnitTestCase::testNamespaces()
- 7.3 lib/Drupal/xautoload/Tests/XAutoloadUnitTestCase.php \Drupal\xautoload\Tests\XAutoloadUnitTestCase::testNamespaces()
File
- lib/
Drupal/ xautoload/ Tests/ XAutoloadUnitTestCase.php, line 62
Class
Namespace
Drupal\xautoload\TestsCode
function testNamespaces() {
// Prepare the class finder.
$finder = new ClassFinder();
$finder
->add('Drupal\\ex_ample', 'sites/all/modules/contrib/ex_ample/lib-psr0');
$finder
->addPsr4('Drupal\\ex_ample', 'sites/all/modules/contrib/ex_ample/lib-psr4');
// Test class finding for 'Drupal\\ex_ample\\Abc_Def'.
$this
->assertFinderSuggestions($finder, 'Drupal\\ex_ample\\Abc_Def', array(
// Class finder is expected to suggest these files, in the exact order,
// until one of them is accepted.
array(
'suggestFile',
'sites/all/modules/contrib/ex_ample/lib-psr0/Drupal/ex_ample/Abc/Def.php',
),
array(
'suggestFile',
'sites/all/modules/contrib/ex_ample/lib-psr4/Abc_Def.php',
),
));
}