/** * Private contructor */ private function __construct() { $this->clearPrefixes(); $this->appendPrefix("JooS"); $prefixes = Config::Helper_Broker()->prefixes(); if (is_array($prefixes)) { foreach ($prefixes as $prefix) { $this->appendPrefix($prefix); } } }
public function testSave() { $event1 = PHPUnit_Testing::getInstance(); $config1 = Config::getInstance("JooS_Event_PHPUnit_Testing"); $this->assertEquals(array(), $config1->valueOf()); $event1->attach(array(__CLASS__, "observerPHPUnitTestingEvent")); $config2 = Config::getInstance("JooS_Event_PHPUnit_Testing"); $this->assertEquals(array(), $config2->valueOf()); $event1->save(); $config3 = Config::getInstance("JooS_Event_PHPUnit_Testing"); $this->assertEquals(array(array(__CLASS__, "observerPHPUnitTestingEvent")), $config3->valueOf()); Event::clearInstance("JooS\\Event\\PHPUnit_Testing"); }
/** * Return log writers * * @return array */ public static function getWriters() { if (is_null(self::$_writers)) { $writers = Config::getInstance("JooS_Log")->writers; /* @var $writers JooS_Config */ if (!is_null($writers)) { foreach ($writers->valueOf() as $name) { $name = ucfirst(strtolower($name)); $className = Loader::getClassName(__NAMESPACE__ . "\\", $name); if (Loader::loadClass($className)) { $writer = new $className(); if ($writer instanceof Log_Interface) { self::addWriter($writer); } } } } else { self::$_writers = array(); } } return self::$_writers; }
protected function tearDown() { $this->_broker = null; if (is_null($this->_prefixes)) { unset(Config::Helper_Broker()->prefixes); } else { Config::Helper_Broker()->prefixes = $this->_prefixes; } }
protected function tearDown() { Config::clearInstance("JooS_Log"); Log::clearWriters(); }
protected function tearDown() { Config::clearDataAdapter(); }
/** * Load observers. * * @return null */ private function _loadObservers() { $class = $this->name(); $name = self::_configName($class); $config = Config::getInstance($name); $this->_observers = $config->valueOf(); }