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; }
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); }
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(); }
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)); }
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); }
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()); }
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')); }
public function testFactoryMethod() { self::assertInstanceOf('\\Nano\\Application', \Nano\Application::create()); self::assertNotSame(\Nano\Application::create(), \Nano\Application::create()); }