本文整理汇总了PHP中Drupal\block\Entity\Block::label方法的典型用法代码示例。如果您正苦于以下问题:PHP Block::label方法的具体用法?PHP Block::label怎么用?PHP Block::label使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\block\Entity\Block
的用法示例。
在下文中一共展示了Block::label方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testHelp
/**
* Logs in users, tests help pages.
*/
public function testHelp()
{
$this->drupalGet('help_page_test/has_help');
$this->assertText(t('I have help!'));
$this->assertText($this->helpBlock->label());
$this->drupalGet('help_page_test/no_help');
// The help block should not appear when there is no help.
$this->assertNoText($this->helpBlock->label());
}
示例2: testHelp
/**
* Logs in users, tests help pages.
*/
public function testHelp()
{
$this->drupalGet('help_page_test/has_help');
$this->assertText(t('I have help!'));
$this->assertText($this->helpBlock->label());
$this->drupalGet('help_page_test/no_help');
// The help block should not appear when there is no help.
$this->assertNoText($this->helpBlock->label());
// Ensure that if two hook_help() implementations both return a render array
// the output is as expected.
$this->drupalGet('help_page_test/test_array');
$this->assertText('Help text from more_help_page_test_help module.');
$this->assertText('Help text from help_page_test_help module.');
}