本文整理汇总了PHP中phpbb\user::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP user::expects方法的具体用法?PHP user::expects怎么用?PHP user::expects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpbb\user
的用法示例。
在下文中一共展示了user::expects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_assign_tagcloud_to_template5
public function test_assign_tagcloud_to_template5()
{
// all tags should be shown
$limit = -1;
$show_count = 'Display all tags.';
$this->user->expects($this->once())->method('lang')->with('RH_TOPICTAGS_DISPLAYING_TOTAL_ALL')->willReturn($show_count);
$this->template->expects($this->once())->method('assign_vars')->with($this->equalTo(array('S_RH_TOPICTAGS_INCLUDE_CSS' => true, 'RH_TOPICTAGS_TAGCLOUD_SHOW_COUNT' => true, 'RH_TOPICTAGS_TAGCLOUD_TAG_COUNT' => $show_count)))->willReturn(true);
$this->template->expects($this->exactly(3))->method('assign_block_vars')->withConsecutive(array('rh_topictags_tags', $this->callback(function ($o) {
$diff = array_diff_assoc(array('NAME' => 'tag1', 'COUNT' => 2), $o);
return sizeof($diff) == 0;
})), array('rh_topictags_tags', $this->callback(function ($o) {
$diff = array_diff_assoc(array('NAME' => 'anothertag3', 'COUNT' => 1), $o);
return sizeof($diff) == 0;
})), array('rh_topictags_tags', $this->callback(function ($o) {
$diff = array_diff_assoc(array('NAME' => 'tag2', 'COUNT' => 0), $o);
return sizeof($diff) == 0;
})))->willReturn(true);
$this->tagcloud_manager->assign_tagcloud_to_template($limit);
}