public function msgAdd(Msg $msg) { #print __CLASS__.'->'.__FUNCTION__.''."\n"; #print __CLASS__.'->'.__FUNCTION__.': '.$msg->getId()."\n"; $filePath = $msg->getFilePath(); if ($this->getDatadirBasePath() && !$filePath) { $filePath = $this->getDatadirBasePath() . '/msg_' . $msg->getId() . '.yml'; } $msg->setFilePath($filePath); $msg->setDatadirBasePath($this->getDatadirBasePath()); $msg->setMsgDb($this); $this->msgs[$msg->getId()] = $msg; $this->setDataChanged(true); }
public function testSetMsgDb() { $this->assertTrue(true); $db1 = new MsgDb(); $msg = new Msg(); $msg->setMsgDb($db1); $db2 = $msg->getMsgDb(); $this->assertEquals($db1, $db2); }