/**
  * Tests registering the autoloader.
  * @covers empire\framework\autoload\Psr4AutoLoader::register
  */
 public function testRegister()
 {
     $this->instance->register();
     $this->assertContains(array($this->instance, 'load'), spl_autoload_functions());
 }
Exemple #2
0
<?php

/**
 * Bootstrap code.
 */
use empire\framework\autoload\psr4\Psr4AutoLoader;
use empire\framework\error\ErrorHandler;
// Register PSR-4 autoloader
$classPath = __DIR__ . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . 'psr4' . DIRECTORY_SEPARATOR . 'Psr4AutoLoader.php';
require_once $classPath;
$autoLoader = new Psr4AutoLoader();
$autoLoader->addNamespace('empire\\framework', __DIR__ . DIRECTORY_SEPARATOR . 'framework');
$autoLoader->register();
// Register error handler
$errorHandler = new ErrorHandler();
$errorHandler->register();
// Load PHPUnit
require_once 'PHPUnit/Autoload.php';