本文整理匯總了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);
}
示例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());
}
示例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);
}
示例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());
}