You are here

function ClassLoaderTest::testPrefixes in X Autoload 7.3

Same name and namespace in other branches
  1. 7.5 tests/src/ClassLoaderTest.php \Drupal\xautoload\Tests\ClassLoaderTest::testPrefixes()
  2. 7.4 tests/lib/ClassLoaderTest.php \Drupal\xautoload\Tests\ClassLoaderTest::testPrefixes()

Test PEAR-like prefixes.

File

tests/Drupal/xautoload/Tests/ClassLoaderTest.php, line 58

Class

ClassLoaderTest

Namespace

Drupal\xautoload\Tests

Code

function testPrefixes() {

  // Prepare the class finder.
  $finder = new \xautoload_ClassFinder_NamespaceOrPrefix();
  $loader = new \xautoload_ClassLoader_NoCache($finder);
  $finder
    ->registerPrefixDeep('ex_ample', 'test://base/lib');
  $finder
    ->registerPrefixRoot('ex_ample', 'test://base/vendor');
  $this
    ->assertloadClass($loader, 'ex_ample_Sub_Foo', 'test://base/lib/Sub/Foo.php');
  $this
    ->assertloadClass($loader, 'ex_ample_Sub_Bar', 'test://base/vendor/ex/ample/Sub/Bar.php');
}