public function ClassLoaderTest::testUseIncludePath

File

drupal/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php, line 91

Class

ClassLoaderTest

Namespace

Symfony\Component\ClassLoader\Tests

Code

public function testUseIncludePath() {
  $loader = new ClassLoader();
  $this
    ->assertFalse($loader
    ->getUseIncludePath());
  $this
    ->assertNull($loader
    ->findFile('Foo'));
  $includePath = get_include_path();
  $loader
    ->setUseIncludePath(true);
  $this
    ->assertTrue($loader
    ->getUseIncludePath());
  set_include_path(__DIR__ . '/Fixtures/includepath' . PATH_SEPARATOR . $includePath);
  $this
    ->assertEquals(__DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'includepath' . DIRECTORY_SEPARATOR . 'Foo.php', $loader
    ->findFile('Foo'));
  set_include_path($includePath);
}