You are here

function ClassLoaderTest::testSpecialUnderscores in X Autoload 7.4

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

Tests PEAR-like class names beginning with underscore, or with a double underscore in between.

File

tests/lib/ClassLoaderTest.php, line 84

Class

ClassLoaderTest

Namespace

Drupal\xautoload\Tests

Code

function testSpecialUnderscores() {

  // Prepare the class finder.
  $finder = new ClassFinder();
  $finder
    ->registerPrefixDeep('_ex_ample', 'test://lib');
  $finder
    ->registerPrefixRoot('_ex_ample', 'test://vendor');

  // Verify that underscores are not a problem..
  $this
    ->assertCandidateOrder($finder, '_ex_ample_Abc%_Def', array(
    'test://lib/Abc%/Def.php',
    'test://vendor/_ex/ample/Abc%/Def.php',
  ));
  $this
    ->assertCandidateOrder($finder, '_abc_Foo%', array());
  $this
    ->assertCandidateOrder($finder, 'abc__Foo%', array());
}