public function load()
 {
     if (isset($_SESSION[self::SESSIONKEY]) && is_array($_SESSION[self::SESSIONKEY])) {
         foreach ($_SESSION[self::SESSIONKEY] as $type => $list) {
             foreach ($list as $num => $msgData) {
                 $x = new Message(false);
                 $x->type = $type;
                 $x->setContents($msgData);
                 $this->add($x);
             }
         }
     }
     $this->init();
 }
Example #2
0
 public function test_getContents()
 {
     $x = new Message();
     $x->setContents(array('title' => __CLASS__, 'body' => __FUNCTION__));
     $message = array('title' => __CLASS__, 'body' => __FUNCTION__, 'url' => '', 'type' => Message::DEFAULT_TYPE, 'linkText' => '');
     $this->assertEquals($message, $x->getContents());
     $this->assertEquals($message, $x->contents);
 }