本文整理匯總了PHP中phpbb\template\template::expects方法的典型用法代碼示例。如果您正苦於以下問題:PHP template::expects方法的具體用法?PHP template::expects怎麽用?PHP template::expects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phpbb\template\template
的用法示例。
在下文中一共展示了template::expects方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test_add_block_double_switch
public function test_add_block_double_switch()
{
$block_name = 'abc';
$switch_expected = true;
$this->language->expects($this->at(0))->method('lang')->with($block_name)->willReturn(strtoupper($block_name));
$this->template->expects($this->at(0))->method('assign_block_vars')->with('faq_block', array('BLOCK_TITLE' => strtoupper($block_name), 'SWITCH_COLUMN' => $switch_expected));
$this->manager->add_block($block_name, true);
$this->assertTrue($this->manager->switched_column());
// Add a second block with switch
$block_name = 'def';
$switch_expected = false;
$this->language->expects($this->at(0))->method('lang')->with($block_name)->willReturn(strtoupper($block_name));
$this->template->expects($this->at(0))->method('assign_block_vars')->with('faq_block', array('BLOCK_TITLE' => strtoupper($block_name), 'SWITCH_COLUMN' => $switch_expected));
$this->manager->add_block($block_name, true);
$this->assertTrue($this->manager->switched_column());
}
示例2: 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);
}