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; }
function testUpdateDetail() { $info = new VoiceInfo($this->data); $infoSub = new VoiceInfo($this->dataSub); $store = new VoiceInfoDB(); $store->updateDetail($infoSub); $result = $store->getDetail($infoSub); $this->assertSame('title_', $result->title); $store->updateDetail($info); $result = $store->getDetail($info); $this->assertSame(999, $result->imageid); $this->assertSame('title', $result->title); $this->assertSame('artist', $result->artist); $this->assertSame('description', $result->description); $this->assertSame(array('hoge', 'huga'), $result->tags); }