当前位置: 首页>>代码示例>>PHP>>正文


PHP Block::delete方法代码示例

本文整理汇总了PHP中Drupal\block\Entity\Block::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Block::delete方法的具体用法?PHP Block::delete怎么用?PHP Block::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\block\Entity\Block的用法示例。


在下文中一共展示了Block::delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testLocalTaskBlock

 /**
  * Tests that local task blocks are configurable to show a specific level.
  */
 public function testLocalTaskBlock()
 {
     // Remove the default block and create a new one.
     $this->sut->delete();
     $this->sut = $this->drupalPlaceBlock('local_tasks_block', ['id' => 'tabs_block', 'primary' => TRUE, 'secondary' => FALSE]);
     $this->drupalGet(Url::fromRoute('menu_test.local_task_test_tasks_settings'));
     // Verify that local tasks in the first level appear.
     $this->assertLocalTasks([['menu_test.local_task_test_tasks_view', []], ['menu_test.local_task_test_tasks_edit', []], ['menu_test.local_task_test_tasks_settings', []]]);
     // Verify that local tasks in the second level doesn't appear.
     $this->assertNoLocalTasks(1);
     $this->sut->delete();
     $this->sut = $this->drupalPlaceBlock('local_tasks_block', ['id' => 'tabs_block', 'primary' => FALSE, 'secondary' => TRUE]);
     $this->drupalGet(Url::fromRoute('menu_test.local_task_test_tasks_settings'));
     // Verify that local tasks in the first level doesn't appear.
     $this->assertNoLocalTasks(0);
     // Verify that local tasks in the second level appear.
     $sub_tasks = [['menu_test.local_task_test_tasks_settings_sub1', []], ['menu_test.local_task_test_tasks_settings_sub2', []], ['menu_test.local_task_test_tasks_settings_sub3', []], ['menu_test.local_task_test_tasks_settings_derived', ['placeholder' => 'derive1']], ['menu_test.local_task_test_tasks_settings_derived', ['placeholder' => 'derive2']]];
     $this->assertLocalTasks($sub_tasks, 1);
 }
开发者ID:sarahwillem,项目名称:OD8,代码行数:22,代码来源:LocalTasksTest.php


注:本文中的Drupal\block\Entity\Block::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。