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


PHP EntityStorageInterface::reveal方法代码示例

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


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

示例1: testImportEntityLoadFailure

 /**
  * Test row skipping when we can't get an entity to save.
  *
  * @covers ::import
  * @expectedException \Drupal\migrate\MigrateException
  * @expectedExceptionMessage Unable to get entity
  */
 public function testImportEntityLoadFailure()
 {
     $bundles = [];
     $destination = new EntityTestDestination([], '', [], $this->migration->reveal(), $this->storage->reveal(), $bundles, $this->entityManager->reveal(), $this->prophesize(FieldTypePluginManagerInterface::class)->reveal());
     $destination->setEntity(FALSE);
     $destination->import(new Row([], []));
 }
开发者ID:318io,项目名称:318-io,代码行数:14,代码来源:EntityContentBaseTest.php

示例2: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->panelsDisplay = $this->prophesize(PanelsDisplayVariant::class);
     $this->pageVariant = $this->prophesize(PageVariantInterface::class);
     $this->pageVariant->getVariantPlugin()->willReturn($this->panelsDisplay->reveal());
     $this->pageVariantNotPanels = $this->prophesize(PageVariantInterface::class);
     $this->pageVariantNotPanels->getContexts()->shouldNotBeCalled();
     $non_panels_variant = $this->prophesize(HttpStatusCodeDisplayVariant::class);
     $this->pageVariantNotPanels->getVariantPlugin()->willReturn($non_panels_variant->reveal());
     $this->storage = $this->prophesize(EntityStorageInterface::class);
     $this->entityTypeManager = $this->prophesize(EntityTypeManagerInterface::class);
     $this->entityTypeManager->getStorage('page_variant')->willReturn($this->storage->reveal());
 }
开发者ID:ns-oxit-study,项目名称:drupal-8-training,代码行数:17,代码来源:PanelsStorageTest.php

示例3: testUntranslatable

 /**
  * Test that translation destination fails for untranslatable entities.
  *
  * @expectedException \Drupal\migrate\MigrateException
  * @expectedExceptionMessage This entity type does not support translation
  */
 public function testUntranslatable()
 {
     // An entity type without a language.
     $entity_type = $this->prophesize(ContentEntityType::class);
     $entity_type->getKey('langcode')->willReturn('');
     $entity_type->getKey('id')->willReturn('id');
     $this->storage->getEntityType()->willReturn($entity_type->reveal());
     $destination = new EntityTestDestination(['translations' => TRUE], '', [], $this->migration->reveal(), $this->storage->reveal(), [], $this->entityManager->reveal(), $this->prophesize(FieldTypePluginManagerInterface::class)->reveal());
     $destination->getIds();
 }
开发者ID:DrupalCamp-NYC,项目名称:dcnyc16,代码行数:16,代码来源:EntityContentBaseTest.php

示例4: getEntityRevisionDestination

 /**
  * Helper method to create an entity revision destination with mock services.
  *
  * @see \Drupal\Tests\migrate\Unit\Destination\EntityRevision
  *
  * @param $configuration
  *   Configuration for the destination.
  * @param string $plugin_id
  *   The plugin id.
  * @param array $plugin_definition
  *   The plugin definition.
  *
  * @return \Drupal\Tests\migrate\Unit\destination\EntityRevision
  *   Mocked destination.
  */
 protected function getEntityRevisionDestination(array $configuration = [], $plugin_id = 'entity_revision', array $plugin_definition = [])
 {
     return new EntityRevision($configuration, $plugin_id, $plugin_definition, $this->migration->reveal(), $this->storage->reveal(), [], $this->entityManager->reveal(), $this->fieldTypeManager->reveal());
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:19,代码来源:EntityRevisionTest.php


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