Example #1
0
 function testUpdateInfo()
 {
     $info = new VoiceInfo($this->data);
     $infoSub = new VoiceInfo($this->dataSub);
     $store = new VoiceInfoDB();
     $store->updateInfo($infoSub);
     $result = $store->getInfo(999);
     $this->assertSame('c:/temp/998.mp3', $result->dst);
     $store->updateInfo($info);
     $result = $store->getInfo(999);
     $this->assertSame('c:/temp/999.mp3', $result->dst);
     $this->assertSame(999, $result->sizeKb);
 }
Example #2
0
 static function getInfo($mid, $opt = null)
 {
     ///// Voice
     if (preg_match("/v([\\d]+)/", $mid, $matches)) {
         $id = intval($matches[1]);
         $voiceDb = new VoiceInfoDB();
         $info = $voiceDb->getInfo($id);
         if ($info && $opt['detail']) {
             $voiceDb->getDetail($info);
         }
         if ($info && $opt['playing']) {
             $voiceDb->getPlaying($info);
         }
         return $info;
     }
     return null;
 }