Example #1
0
 public function testCompletelyMissingPullDrivenRequest()
 {
     $this->object->setControllerPath(null);
     $this->object->bootstrap("view", function () {
         $v = new View();
         $v->setViewPath(__DIR__ . '/views');
         return $v;
     });
     ob_start();
     $this->object->run(new Request("/pull/driven"));
     $content = ob_get_contents();
     ob_end_clean();
     $this->assertEquals("<h1>Complete pull driven</h1>", $content);
 }
Example #2
0
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
define("APPLICATION_ENV", 'development');
$app = new Application();
$app->setControllerPath(__DIR__ . '/../app/controllers');
$classLoader = new \Doctrine\Common\ClassLoader('Wdm', __DIR__ . '/../app/models');
$classLoader->register();
$app->bootstrap("config", function () {
    $config = new Config();
    $config->load(__DIR__ . '/../app/configs/application.ini');
    return $config;
});
$app->bootstrap("view", function () {
    $view = new View();
    $view->setViewPath(__DIR__ . '/../app/views');
    return $view;
});
$app->bootstrap("layout", function () {
    $layout = new Layout();
    $layout->setViewPath(__DIR__ . '/../app/layouts');
    return $layout;
});
$app->bootstrap("entityManager", function () use($app) {
    $config = new \Doctrine\ORM\Configuration();
    // (2)
    // Proxy Configuration
    $config->setProxyDir(__DIR__ . '/../app/models/Wdm/Proxies');
    $config->setProxyNamespace('Wdm\\Proxies');
    $config->setAutoGenerateProxyClasses(APPLICATION_ENV == "development");
    // Mapping Configuration