Esempio n. 1
0
 /**
  * Can we add a stack when the profiler is disabled?
  *
  * @access public
  */
 public function testAddingStackToProfilerWhilstDisabled()
 {
     // Load the config file
     Core\Config::load('MyProject');
     Core\Config::set('profiler', 'enable', false, true);
     $this->assertFalse(Core\Profiler::register('Foo', 'bar'));
 }
Esempio n. 2
0
 /**
  * Can we call a View Helper and get the expected result?
  *
  * @access public
  */
 public function testViewHelper()
 {
     // Load the config file
     Core\Config::load('MyProject');
     // Get a new View
     $view = new Core\View();
     // Load a View Helper
     $viewHelperContent = $view->test(array('testVar' => 'foo'));
     // And test
     $this->assertEquals($viewHelperContent, 'Test var: foo');
 }
Esempio n. 3
0
 /**
  * Can we create a cached object?
  *
  * @access public
  */
 public function testCreateCachedObject()
 {
     // Load the config file
     Core\Config::load('MyProject');
     Core\Config::set('cache', 'enable', true, true);
     // Put the cache
     Core\Cache::put('foo', 'bar');
     // The file exists?
     $this->assertTrue(Core\Cache::has('foo'));
     // And the file has the correct contents?
     $this->assertEquals(Core\Cache::get('foo'), 'bar');
 }
Esempio n. 4
0
 public static function run($func = NULL)
 {
     if (!defined('APP_RUN')) {
         Core\Config::load(CONF_PATH . DS . 'bootstrap.php');
         if (is_callable($func)) {
             call_user_func($func);
         }
         self::exceptionHandler();
         self::errorHandler();
         self::registerShutdown();
         Core\App::instance()->run();
         define('APP_RUN', TRUE);
     }
 }
Esempio n. 5
0
 /**
  * Do we have all of the config settings that are needed?
  *
  * @access public
  */
 public function testConfigCoreVariablesExist()
 {
     // Load the config file
     Core\Config::load('MyProject');
     // Settings
     $this->assertNotNull(Core\Config::get('settings', 'project'));
     // Paths
     $this->assertNotNull(Core\Config::get('path', 'base'));
     $this->assertNotNull(Core\Config::get('path', 'root'));
     $this->assertNotNull(Core\Config::get('path', 'project'));
     $this->assertNotNull(Core\Config::get('path', 'cache'));
     // Cache
     $this->assertNotNull(Core\Config::get('cache', 'enable'));
     $this->assertNotNull(Core\Config::get('cache', 'life'));
 }