public function testInitWithVerifier()
 {
     $config = new Standard(getcwd());
     $verifier = new LowlevelChecks($config);
     $config->setVerifier($verifier);
     $config->verify();
 }
 public function testInitWithClassloader()
 {
     $loader = (require BOLT_AUTOLOAD);
     $config = new Standard($loader);
     $app = new Application(array('resources' => $config));
     $this->assertEquals('/app/', $config->getUrl('app'));
 }
Exemple #3
0
 protected function makeApp()
 {
     $config = new Standard(TEST_ROOT);
     $config->verify();
     $bolt = new Application(['resources' => $config]);
     $bolt['session.test'] = true;
     $bolt['debug'] = false;
     $bolt['config']->set('general/database', ['driver' => 'pdo_sqlite', 'prefix' => 'bolt_', 'user' => 'test', 'path' => TEST_ROOT . '/bolt.db']);
     $bolt['config']->set('general/canonical', 'bolt.dev');
     $bolt['resources']->setPath('files', PHPUNIT_ROOT . '/resources/files');
     $bolt['slugify'] = Slugify::create();
     return $bolt;
 }
Exemple #4
0
 public function compat()
 {
     if (!defined("BOLT_COMPOSER_INSTALLED")) {
         define('BOLT_COMPOSER_INSTALLED', true);
     }
     parent::compat();
 }
Exemple #5
0
 /**
  * Constructor initialises on the app root path.
  *
  * @param string  $path
  * @param Request $request
  */
 public function __construct($path, Request $request = null)
 {
     parent::__construct($path, $request);
     $this->setPath('composer', realpath(dirname(__DIR__) . '/../'));
     $this->setPath('app', realpath(dirname(__DIR__) . '/../app/'));
     $this->setUrl('app', '/bolt-public/');
 }
Exemple #6
0
 /**
  * Constructor initialises on the app root path.
  *
  * @param string  $path
  * @param Request $request
  */
 public function __construct($path, Request $request = null)
 {
     parent::__construct($path, $request);
     $this->setPath('composer', realpath(dirname(__DIR__) . '/../'));
     $this->setPath('app', realpath(dirname(__DIR__) . '/../app/'));
     $this->setPath('view', realpath(dirname(__DIR__) . '/../app/view'));
     $this->setPath('cache', 'app/cache');
     $this->setPath('config', 'app/config');
     $this->setPath('database', 'app/database');
     $this->setPath('web', 'public');
     $this->setPath('themebase', 'public/theme');
     $this->setPath('files', 'public/files');
     $this->setPath('view', 'public/bolt-public/view');
     $this->setUrl('app', '/bolt-public/');
     $this->setUrl('view', '/bolt-public/view/');
 }
 public function testSetThemePath()
 {
     $config = new Standard(TEST_ROOT);
     $theme = ['theme' => 'test'];
     $config->setThemePath($theme);
     $this->assertEquals(Path::fromString(TEST_ROOT . '/theme/test'), $config->getPath('theme'));
     $theme = ['theme' => 'test', 'theme_path' => '/testpath'];
     $config->setThemePath($theme);
     $this->assertEquals(Path::fromString(TEST_ROOT . '/testpath/test'), $config->getPath('theme'));
 }