Esempio n. 1
0
 /**
  * Can we add stacks to the profiler, and they arrange themselves correctly?
  *
  * @access public
  */
 public function testAddingStackToProfile()
 {
     // Enable the profiler
     Core\Config::set('profiler', 'enable', true, true);
     // Add a stack
     Core\Profiler::register('Foo', 'bar');
     $stack = Core\Profiler::getProfilerData();
     $this->assertTrue(is_array($stack['stack']));
     $this->assertEquals(1, count($stack['stack']));
 }
Esempio n. 2
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. 3
0
 /**
  * By default you cannot overwrite config variables. You need to pass the
  * forth variable 'true' to make sure you are not doing something bad.
  *
  * @access public
  */
 public function testConfigOverwritingVariableWithOverwritePassed()
 {
     // This should overwrite
     Core\Config::set('settings', 'foo', 'foobar', true);
     $this->assertEquals(Core\Config::get('settings', 'foo'), 'foobar');
 }