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


PHP DisplayPluginBase::expects方法代码示例

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


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

示例1: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->entityManager = $this->getMock('Drupal\\Core\\Entity\\EntityManagerInterface');
     $this->entityStorage = $this->getMock('Drupal\\Core\\Entity\\EntityStorageInterface');
     $this->entityViewBuilder = $this->getMock('Drupal\\Core\\Entity\\EntityViewBuilderInterface');
     $this->executable = $this->getMockBuilder('Drupal\\views\\ViewExecutable')->disableOriginalConstructor()->getMock();
     $this->display = $this->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\DisplayPluginBase')->disableOriginalConstructor()->getMock();
     $this->stylePlugin = $this->getMockBuilder('Drupal\\views\\Plugin\\views\\style\\StylePluginBase')->disableOriginalConstructor()->getMock();
     $this->executable->style_plugin = $this->stylePlugin;
     $this->entityHandler = new Entity(array(), 'entity', array('entity_type' => 'entity_test'), $this->entityManager);
     $this->display->expects($this->any())->method('getPlugin')->with('style')->willReturn($this->stylePlugin);
     $this->executable->expects($this->any())->method('getStyle')->willReturn($this->stylePlugin);
     $token = $this->getMockBuilder('Drupal\\Core\\Utility\\Token')->disableOriginalConstructor()->getMock();
     $token->expects($this->any())->method('replace')->willReturnArgument(0);
     $container = new ContainerBuilder();
     $container->set('token', $token);
     \Drupal::setContainer($container);
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:22,代码来源:EntityTest.php

示例2: testGetRenderTokensWithArguments

 /**
  * @covers ::getRenderTokens
  */
 public function testGetRenderTokensWithArguments()
 {
     $field = $this->setupTestField(['id' => 'id']);
     $field->view->args = ['argument value'];
     $field->view->build_info['substitutions']['{{ arguments.name }}'] = 'argument value';
     $argument = $this->getMockBuilder('\\Drupal\\views\\Plugin\\views\\argument\\ArgumentPluginBase')->disableOriginalConstructor()->getMock();
     $field->last_render = 'last rendered output';
     $this->display->expects($this->any())->method('getHandlers')->willReturnMap([['argument', ['name' => $argument]], ['field', ['id' => $field]]]);
     $expected = ['{{ id }}' => 'last rendered output', '{{ arguments.name }}' => 'argument value', '{{ raw_arguments.name }}' => 'argument value'];
     $this->assertEquals($expected, $field->getRenderTokens([]));
 }
开发者ID:dmyerson,项目名称:d8ecs,代码行数:14,代码来源:FieldPluginBaseTest.php

示例3: setupDisplayWithEmptyArgumentsAndFields

 /**
  * Sets up a display with empty arguments and fields.
  */
 protected function setupDisplayWithEmptyArgumentsAndFields()
 {
     $this->display->expects($this->any())->method('getHandlers')->willReturnMap([['argument', []], ['field', []]]);
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:7,代码来源:FieldPluginBaseTest.php


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