本文整理汇总了PHP中AppModel::getUserTimeline方法的典型用法代码示例。如果您正苦于以下问题:PHP AppModel::getUserTimeline方法的具体用法?PHP AppModel::getUserTimeline怎么用?PHP AppModel::getUserTimeline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppModel
的用法示例。
在下文中一共展示了AppModel::getUserTimeline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetUserTimeline
function testGetUserTimeline()
{
$result = $this->TestModel->getUserTimeline();
foreach ($result as $tweet) {
$this->assertEqual($tweet['user']['id'], 152934772);
}
// -- change user
$result = $this->TestModel->getUserTimeline('nojimage');
foreach ($result as $tweet) {
$this->assertEqual($tweet['user']['id'], 15982041);
}
$this->TestModel->data = array($this->TestModel->alias => array($this->TestModel->primaryKey => 'nojimage'));
$result = $this->TestModel->getUserTimeline();
foreach ($result as $tweet) {
$this->assertEqual($tweet['user']['id'], 15982041);
}
// -- limit
$result = $this->TestModel->getUserTimeline(array('id' => 'nojimage', 'count' => 10));
$this->assertTrue(count($result) <= 10);
// -- max_id
$last_id = $result[count($result) - 1]['id_str'];
$result = $this->TestModel->getUserTimeline(array('id' => 'nojimage', 'max_id' => $last_id));
$this->assertEqual($result[0]['id'], $last_id);
// -- paging
$next_id = $result[1]['id'];
$result = $this->TestModel->getUserTimeline(array('id' => 'nojimage', 'count' => 10, 'page' => 2));
$this->assertEqual($result[0]['id'], $next_id);
// -- exclude reply
$result = $this->TestModel->getUserTimeline(array('id' => 'nojimage', 'page' => 2, 'exclude_reply' => true));
foreach ($result as $tweet) {
$this->assertPattern('/^[^@]/u', $tweet['text'], $tweet['text']);
}
}