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


PHP FilterFormat::expects方法代码示例

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


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

示例1: setUp

 protected function setUp()
 {
     // Mock text format configuration entity object.
     $this->format = $this->getMockBuilder('\\Drupal\\filter\\Entity\\FilterFormat')->disableOriginalConstructor()->getMock();
     $this->format->expects($this->any())->method('getFilterTypes')->will($this->returnValue(array(FilterInterface::TYPE_HTML_RESTRICTOR)));
     $restrictions = array('allowed' => array('p' => TRUE, 'a' => TRUE, '*' => array('style' => FALSE, 'on*' => FALSE)));
     $this->format->expects($this->any())->method('getHtmlRestrictions')->will($this->returnValue($restrictions));
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:8,代码来源:StandardTest.php

示例2: setUpBuildForm

 /**
  * Sets up mocks for buildForm() calls.
  *
  * @param object $asset
  *   An asset to load from the entity type manager.
  */
 private function setUpBuildForm($asset = NULL)
 {
     $this->mockFilter->expects($this->exactly(2))->method('id')->willReturn(self::MOCK_FILTER_ID);
     $filter_align = new \stdClass();
     $filter_align->status = 1;
     $this->mockFilter->expects($this->once())->method('filters')->with('filter_align')->willReturn($filter_align);
     $catalog_id = 'test_catalog';
     $editor_settings['plugins']['embridgeimage']['embridge_image_upload'] = ['max_size' => '2 MB', 'library_id' => 101, 'catalog_id' => $catalog_id, 'directory' => 'test-directory'];
     $mock_editor = $this->getMockBuilder(Editor::class)->disableOriginalConstructor()->getMock();
     $mock_editor->expects($this->once())->method('getSettings')->willReturn($editor_settings);
     $mock_editor_storage = $this->getMockBuilder(EntityStorageInterface::class)->disableOriginalConstructor()->getMock();
     $mock_editor_storage->expects($this->once())->method('load')->with(self::MOCK_FILTER_ID)->willReturn($mock_editor);
     $mock_catalog = $this->getMockBuilder(EmbridgeCatalog::class)->disableOriginalConstructor()->getMock();
     $mock_catalog->expects($this->any())->method('getApplicationId')->willReturn('test_application');
     $mock_catalog->expects($this->once())->method('getConversionsArray')->willReturn(['thumb', 'medium', 'large']);
     $mock_catalog_storage = $this->getMockBuilder(EntityStorageInterface::class)->disableOriginalConstructor()->getMock();
     $mock_catalog_storage->expects($this->once())->method('load')->with($catalog_id)->willReturn($mock_catalog);
     $map = [['editor', $mock_editor_storage], ['embridge_catalog', $mock_catalog_storage]];
     if ($asset) {
         $mock_asset_storage = $this->getMockBuilder(EntityStorageInterface::class)->disableOriginalConstructor()->getMock();
         $mock_asset_storage->expects($this->once())->method('load')->willReturn($asset);
         $map[] = ['embridge_asset_entity', $mock_asset_storage];
     }
     $this->entityTypeManager->expects($this->exactly(count($map)))->method('getStorage')->will($this->returnValueMap($map));
 }
开发者ID:acbramley,项目名称:embridge,代码行数:31,代码来源:EmbridgeCkeditorImageDialogTest.php


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