Exemplo n.º 1
0
 /**
  * @covers Pushy\Core\Autoloader::__construct
  * @covers Pushy\Core\Autoloader::register
  * @covers Pushy\Core\Autoloader::load
  */
 public function testLoadUnknownClass()
 {
     $autoloader = new Autoloader('FakeProject', dirname(__DIR__) . '/../Mocks/Core\\\\/\\//');
     $this->assertTrue($autoloader->register());
     $this->assertFalse($autoloader->load('IDontExistClass'));
 }
Exemplo n.º 2
0
use Pushy\Http\Response;
use Pushy\Router\RouteFactory;
use Pushy\Router\Router;
use Pushy\Router\FrontController;
/**
 * Bootstrap the Commentar library
 */
require_once __DIR__ . '/src/Pushy/bootstrap.php';
/**
 * Start the session
 */
session_start();
/**
 * Setup autoloader for the demo
 */
$autoloader = new Autoloader(__NAMESPACE__, dirname(__DIR__));
$autoloader->register();
/**
 * Load the environment
 */
require_once __DIR__ . '/init.deployment.php';
/**
 * Prevent rendering of pages when on CLI
 */
if (php_sapi_name() === 'cli') {
    return;
}
/**
 * Setup the request object
 */
$request = new Request(new ImmutableArray($_GET), new ImmutableArray($_POST), new ImmutableArray($_SERVER), new ImmutableArray($_FILES));