Exemple #1
0
 protected function setUp()
 {
     $this->app->backup();
     $this->application = new \Nano\Application();
     $this->application->withConfigurationFormat('php')->withRootDir($GLOBALS['application']->rootDir)->withModule('example', __DIR__ . '/_files/example')->withModule('another-example', __DIR__ . '/_files/another-example')->configure();
     $this->helper = $this->application->helper;
 }
Exemple #2
0
 protected function setUp()
 {
     $this->app->backup();
     $this->application = new \Nano\Application();
     $this->application->withConfigurationFormat('php')->withRootDir(__DIR__);
     $this->files->clean($this, '/settings');
     $this->builder = new \Nano\Application\Config\Builder($this->application);
 }
Exemple #3
0
 protected function setUp()
 {
     $this->app->backup();
     $this->application = new \Nano\Application();
     $this->application->withRootDir(__DIR__ . DS . '_files');
     $this->log = new \Nano\Util\Log($this->application);
     $this->log->clear();
 }
Exemple #4
0
 protected function setUp()
 {
     $this->app->backup();
     include_once $this->files->get($this, '/TestRunnableRoute.php');
     $this->application = new \Nano\Application();
     $this->application->withConfigurationFormat('php')->withRootDir($GLOBALS['application']->rootDir)->configure();
     $this->application->dispatcher->setResponse(new \Nano\Controller\Response\Test($this->application));
 }
Exemple #5
0
 protected function setUp()
 {
     $this->app->backup();
     require_once $this->files->get($this, '/controllers/Test.php');
     $this->application = new \Nano\Application();
     $this->application->withRootDir($GLOBALS['application']->rootDir)->withConfigurationFormat('php')->withModule('module1', $this->files->get($this, '/module1'))->withModule('module2', $this->files->get($this, '/module2'))->configure();
     $this->renderer = new \Nano\Render($this->application);
     $this->renderer->setViewsPath($this->files->get($this, '/views'));
     $this->renderer->setModuleViewsDirName('views/default');
     $this->renderer->setLayoutsPath($this->files->get($this, '/layouts'));
     $this->controller = new \App\Controller\Test($this->application);
 }
Exemple #6
0
 public function testShouldStoreApplicationOnlyOnce()
 {
     $original = Nano::app();
     $this->mixin->backup();
     $new = \Nano\Application::create()->withConfigurationFormat('php')->withRootDir(__DIR__)->configure();
     $this->mixin->backup();
     self::assertInstanceOf('\\Nano\\Application', self::getObjectProperty($this->mixin, 'backup'));
     self::assertSame($original, self::getObjectProperty($this->mixin, 'backup'));
     self::assertNull(Nano::app());
 }
Exemple #7
0
 protected function setUp()
 {
     $this->app->backup();
     \Nano\Application::create()->withConfigurationFormat('php')->withRootDir($GLOBALS['application']->rootDir)->withModule('some', __DIR__ . '/_files')->configure();
     $this->dictionary = new \Nano\L10n\Dictionary(new \Nano\L10n\Locale('ru'));
 }
Exemple #8
0
 public function testFactoryMethod()
 {
     self::assertInstanceOf('\\Nano\\Application', \Nano\Application::create());
     self::assertNotSame(\Nano\Application::create(), \Nano\Application::create());
 }