You are here

public function ClassLoaderTest::testSupportsTraitAutoloading in Plug 7

File

lib/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php, line 108

Class

ClassLoaderTest

Namespace

Doctrine\Tests\Common

Code

public function testSupportsTraitAutoloading() {
  if (!function_exists('trait_exists')) {
    $this
      ->markTestSkipped('You need a PHP version that supports traits in order to run this test');
  }
  $classLoader = new ClassLoader();
  $classLoader
    ->setIncludePath(__DIR__);
  $classLoader
    ->setFileExtension('.class.php');
  $classLoader
    ->setNamespaceSeparator('_');
  $this
    ->assertTrue($classLoader
    ->loadClass('ClassLoaderTest_TraitA'));
  $this
    ->assertTrue(trait_exists('ClassLoaderTest_TraitA', false));
}