Beispiel #1
0
 protected function setUp()
 {
     $this->app->backup();
     $application = new \Nano\Application();
     $application->withRootDir($GLOBALS['application']->rootDir)->withConfigurationFormat('php')->configure();
     $this->response = new \Nano\Controller\Response($application);
 }
Beispiel #2
0
 protected function setUp()
 {
     $this->app->backup();
     $application = new \Nano\Application();
     $application->withConfigurationFormat('php')->withRootDir(dirName(dirName(dirName(__DIR__))) . DS . 'application-example')->configure();
     $this->redirect = new \Nano\Controller\Redirect(new \Nano\Controller\Response($application));
 }
Beispiel #3
0
 protected function setUp()
 {
     $this->app->backup();
     include_once $this->files->get($this, '/TestController.php');
     $application = new \Nano\Application();
     $application->withRootDir($GLOBALS['application']->rootDir)->withConfigurationFormat('php')->withPlugin($this)->configure();
     $this->controller = new Core_C_TestController($application);
     $this->resetWasRun();
 }
Beispiel #4
0
 protected function setUp()
 {
     $this->app->backup();
     require_once $this->files->get($this, '/Test_Dispatcher.php');
     $application = new \Nano\Application();
     $application->withConfigurationFormat('php')->withRootDir(__DIR__)->configure();
     $this->dispatcher = $application->dispatcher;
     $this->dispatcher->setCustom(new Test_Dispatcher());
     $this->dispatcher->throwExceptions(true);
 }
Beispiel #5
0
 public function testDetectingContextBySuffix()
 {
     Nano::setApplication(null);
     $application = new \Nano\Application();
     $application->withConfigurationFormat('php')->withRootDir($this->files->get($this, ''))->configure();
     $application->dispatcher->setResponse(new \Nano\Controller\Response\Test($application));
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $routes = new \Nano\Routes();
     $routes->suffix('~(\\.(?P<context>xml|rss))?')->get('index', 'test', 'index');
     self::assertInstanceOf('Nano\\Route\\RegExp', $application->dispatcher->getRoute($routes, 'index.xml'));
     $application->dispatcher->run($application->dispatcher->getRoute($routes, 'index.xml'));
     self::assertEquals('xml', $application->dispatcher->controllerInstance()->context);
 }
Beispiel #6
0
 protected function setUp()
 {
     $this->app->backup();
     ob_start();
     $this->setUseOutputBuffering(true);
     $application = new \Nano\Application();
     $application->withRootDir($GLOBALS['application']->rootDir)->withConfigurationFormat('php')->configure();
     $this->appRoot = dirName(__DIR__) . '/Application/_files';
     $this->nanoRoot = $application->nanoRootDir;
     $this->cwd = getCwd();
     $this->cli = new \Nano\Cli();
     chDir($this->appRoot);
 }
Beispiel #7
0
<?php

$application = new \Nano\Application();
$application->withConfigurationFormat('php')->withRootDir(__DIR__)->withModulesDir(__DIR__ . DIRECTORY_SEPARATOR . 'application-modules')->withSharedModulesDir(__DIR__ . DIRECTORY_SEPARATOR . 'shared-modules')->withModule('module1')->withModule('module2')->withModule('module3')->withModule('module4')->withModule('module5')->configure();
Beispiel #8
0
<?php

require_once __DIR__ . '/../library/Application.php';
$application = new \Nano\Application();
$application->withConfigurationFormat('php')->withRootDir(__DIR__)->withPlugin(new Nano\TestUtils\Coverage\Plugin(__DIR__))->configure();