You are here

public function AutoloaderTest::testAutoload in Plug 7

File

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