當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TypedDataManager::reveal方法代碼示例

本文整理匯總了PHP中Drupal\Core\TypedData\TypedDataManager::reveal方法的典型用法代碼示例。如果您正苦於以下問題:PHP TypedDataManager::reveal方法的具體用法?PHP TypedDataManager::reveal怎麽用?PHP TypedDataManager::reveal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\Core\TypedData\TypedDataManager的用法示例。


在下文中一共展示了TypedDataManager::reveal方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->typedDataManager = $this->prophesize(TypedDataManager::class);
     $this->entityRepository = $this->prophesize(EntityRepositoryInterface::class);
     $this->staticContext = new ContextMapper($this->entityRepository->reveal());
     $container = new ContainerBuilder();
     $container->set('typed_data_manager', $this->typedDataManager->reveal());
     \Drupal::setContainer($container);
 }
開發者ID:ns-oxit-study,項目名稱:drupal-8-training,代碼行數:13,代碼來源:ContextMapperTest.php

示例2: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->typedDataManager = $this->prophesize(TypedDataManager::class);
     $container = new ContainerBuilder();
     $container->set('string_translation', $this->getStringTranslationStub());
     $container->set('typed_data_manager', $this->typedDataManager->reveal());
     \Drupal::setContainer($container);
     $this->page = $this->prophesize(PageInterface::class);
     $this->event = new PageManagerContextEvent($this->page->reveal());
 }
開發者ID:nB-MDSO,項目名稱:mdso-d8blog,代碼行數:14,代碼來源:PageContextTestBase.php

示例3: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->typedDataManager = $this->prophesize(TypedDataManager::class);
     $container = new ContainerBuilder();
     $container->set('string_translation', $this->getStringTranslationStub());
     $container->set('typed_data_manager', $this->typedDataManager->reveal());
     \Drupal::setContainer($container);
     $this->executable = $this->getMockBuilder(PageExecutable::class)->disableOriginalConstructor()->setMethods(['getPage', 'addContext'])->getMock();
     $this->event = new PageManagerContextEvent($this->executable);
 }
開發者ID:neeravbm,項目名稱:unify-d8,代碼行數:14,代碼來源:PageContextTestBase.php

示例4: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->moduleHandler = $this->prophesize(ModuleHandlerInterface::class);
     $this->moduleHandler->getImplementations('entity_type_build')->willReturn([]);
     $this->moduleHandler->alter('entity_type', Argument::type('array'))->willReturn(NULL);
     $this->moduleHandler->alter('entity_base_field_info', Argument::type('array'), Argument::any())->willReturn(NULL);
     $this->moduleHandler->alter('entity_bundle_field_info', Argument::type('array'), Argument::any(), Argument::type('string'))->willReturn(NULL);
     $this->cacheBackend = $this->prophesize(CacheBackendInterface::class);
     $this->cacheTagsInvalidator = $this->prophesize(CacheTagsInvalidatorInterface::class);
     $language = new Language(['id' => 'en']);
     $this->languageManager = $this->prophesize(LanguageManagerInterface::class);
     $this->languageManager->getCurrentLanguage()->willReturn($language);
     $this->languageManager->getLanguages()->willReturn(['en' => (object) ['id' => 'en']]);
     $this->typedDataManager = $this->prophesize(TypedDataManager::class);
     $this->typedDataManager->getDefinition('field_item:boolean')->willReturn(['class' => BooleanItem::class]);
     $this->eventDispatcher = $this->prophesize(EventDispatcherInterface::class);
     $this->keyValueFactory = $this->prophesize(KeyValueFactoryInterface::class);
     $this->container = $this->prophesize(ContainerInterface::class);
     $this->container->get('cache_tags.invalidator')->willReturn($this->cacheTagsInvalidator->reveal());
     $this->container->get('typed_data_manager')->willReturn($this->typedDataManager->reveal());
     \Drupal::setContainer($this->container->reveal());
     $this->discovery = $this->prophesize(DiscoveryInterface::class);
     $translation_manager = $this->prophesize(TranslationInterface::class);
     $this->entityManager = new TestEntityManager(new \ArrayObject(), $this->moduleHandler->reveal(), $this->cacheBackend->reveal(), $this->languageManager->reveal(), $translation_manager->reveal(), $this->getClassResolverStub(), $this->typedDataManager->reveal(), $this->keyValueFactory->reveal(), $this->eventDispatcher->reveal());
     $this->entityManager->setContainer($this->container->reveal());
     $this->entityManager->setDiscovery($this->discovery->reveal());
 }
開發者ID:HakS,項目名稱:drupal8_training,代碼行數:31,代碼來源:EntityManagerTest.php


注:本文中的Drupal\Core\TypedData\TypedDataManager::reveal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。