You are here

public function ClassLoaderTest::testSupportsTraitAutoloading in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php \Doctrine\Tests\Common\ClassLoaderTest::testSupportsTraitAutoloading()

File

vendor/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));
}