示例#1
0
文件: LogTest.php 项目: covex-nn/joos
 public function testObserver()
 {
     Config::newInstance("JooS_Log", array("writers" => array("output", "null")));
     $event = Log_Event::getInstance();
     $event->message = "qwerty";
     ob_start();
     Log::observer($event);
     $text = ob_get_contents();
     ob_clean();
     $this->assertEquals("qwerty" . PHP_EOL, $text);
 }
示例#2
0
文件: Event.php 项目: covex-nn/joos
 /**
  * Save observers
  * 
  * @return boolean
  */
 public final function save()
 {
     $class = $this->name();
     $name = self::_configName($class);
     $observers = $this->observers();
     $config = Config::newInstance($name, $observers);
     return $config->save();
 }