本文整理匯總了PHP中InsightMySQLDAO::getInsightByUsername方法的典型用法代碼示例。如果您正苦於以下問題:PHP InsightMySQLDAO::getInsightByUsername方法的具體用法?PHP InsightMySQLDAO::getInsightByUsername怎麽用?PHP InsightMySQLDAO::getInsightByUsername使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類InsightMySQLDAO
的用法示例。
在下文中一共展示了InsightMySQLDAO::getInsightByUsername方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetInsightByUsername
public function testGetInsightByUsername()
{
$builders = self::buildData();
$builders[] = FixtureBuilder::build('instances', array('id' => 1, 'network_username' => 'jo', 'network' => 'twitter'));
$dao = new InsightMySQLDAO();
$result = $dao->getInsightByUsername('jo', 'twitter', 'avg_replies_per_week', '2012-05-01');
$this->assertIsA($result, 'Insight');
$this->assertEqual($result->slug, 'avg_replies_per_week');
$this->assertEqual(date('Y-m-d', strtotime($result->date)), '2012-05-01');
$this->assertEqual($result->instance_id, 1);
$this->assertEqual($result->headline, 'Booyah!');
$this->assertEqual($result->text, 'Retweet spike! Your post got retweeted 110 times');
$this->assertEqual($result->emphasis, Insight::EMPHASIS_HIGH);
$result = $dao->getInsightByUsername('jo', 'twitter', 'avg_replies_per_week', '2012-05-02');
$this->assertNull($result);
}