You are here

public function AutoloaderTest::testAutoload in Zircon Profile 8.0

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

File

vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php, line 48

Class

AutoloaderTest
@group DDC-1698

Namespace

Doctrine\Tests\Common\Proxy

Code

public function testAutoload() {
  if (file_exists(sys_get_temp_dir() . "/AutoloaderTestClass.php")) {
    unlink(sys_get_temp_dir() . "/AutoloaderTestClass.php");
  }
  $autoloader = Autoloader::register(sys_get_temp_dir(), 'ProxyAutoloaderTest', function ($proxyDir, $proxyNamespace, $className) {
    file_put_contents(sys_get_temp_dir() . "/AutoloaderTestClass.php", "<?php namespace ProxyAutoloaderTest; class AutoloaderTestClass {} ");
  });
  $this
    ->assertTrue(class_exists('ProxyAutoloaderTest\\AutoloaderTestClass', true));
  unlink(sys_get_temp_dir() . "/AutoloaderTestClass.php");
}