Esempio n. 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);
 }
Esempio n. 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));
 }
Esempio n. 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();
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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();
Esempio n. 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();