예제 #1
0
 public function testInitWithVerifier()
 {
     $config = new Standard(getcwd());
     $verifier = new LowlevelChecks($config);
     $config->setVerifier($verifier);
     $config->verify();
 }
예제 #2
0
 public function testInitWithClassloader()
 {
     $loader = (require BOLT_AUTOLOAD);
     $config = new Standard($loader);
     $app = new Application(array('resources' => $config));
     $this->assertEquals('/app/', $config->getUrl('app'));
 }
예제 #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;
 }
예제 #4
0
 public function compat()
 {
     if (!defined("BOLT_COMPOSER_INSTALLED")) {
         define('BOLT_COMPOSER_INSTALLED', true);
     }
     parent::compat();
 }
예제 #5
0
파일: Composer.php 프로젝트: nuffer/bolt
 /**
  * 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/');
 }
예제 #6
0
파일: Composer.php 프로젝트: bolt/bolt
 /**
  * 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/');
 }
예제 #7
0
 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'));
 }