本文整理汇总了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);
}