本文整理匯總了PHP中Symfony\Component\DependencyInjection\ContainerInterface::reveal方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContainerInterface::reveal方法的具體用法?PHP ContainerInterface::reveal怎麽用?PHP ContainerInterface::reveal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\DependencyInjection\ContainerInterface
的用法示例。
在下文中一共展示了ContainerInterface::reveal方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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());
}
示例2: setUp
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$crop_storage = $this->prophesize(CropStorageInterface::class);
$entity_type_manager = $this->prophesize(EntityTypeManager::class);
$entity_type_manager->getStorage('crop')->willReturn($crop_storage);
$this->container = $this->prophesize(ContainerInterface::class);
$this->container->get('entity_type.manager')->willReturn($entity_type_manager);
$request = $this->prophesize(Request::class);
$this->container->get('request')->willReturn($request);
$this->focalPointManager = new FocalPointManager($entity_type_manager->reveal());
$this->container->get('focal_point.manager')->willReturn($this->focalPointManager);
\Drupal::setContainer($this->container->reveal());
}
示例3: getCommandTester
private function getCommandTester($remote = false, $backup = [])
{
$this->container->getParameter('nanbando.storage.local_directory')->willReturn('/User/test/nanbando');
$this->container->getParameter('nanbando.backup')->willReturn($backup);
$this->container->hasParameter('nanbando.application.name')->willReturn(true);
$this->container->getParameter('nanbando.application.name')->willReturn('sulu');
$this->container->hasParameter('nanbando.application.version')->willReturn(true);
$this->container->getParameter('nanbando.application.version')->willReturn('1.3');
$this->container->hasParameter('nanbando.application.options')->willReturn(true);
$this->container->getParameter('nanbando.application.options')->willReturn([]);
$this->container->has('filesystem.remote')->willReturn($remote);
$this->container->get('presets')->willReturn($this->presetStore->reveal());
$this->container->get('plugins')->willReturn($this->plugins->reveal());
$command = new CheckCommand();
$command->setContainer($this->container->reveal());
$application = new Application();
$application->add($command);
$command = $application->find('check');
return new CommandTester($command);
}
示例4: setUp
public function setUp()
{
$this->container = $this->prophesize(ContainerInterface::class);
$this->sut = new ContainerParameterRetriever($this->name, $this->container->reveal());
}
開發者ID:bartfeenstra,項目名稱:dependency-retriever-symfony-bridge,代碼行數:5,代碼來源:ContainerParameterRetrieverTest.php
示例5: setUp
/**
* {@inheritdoc}
*/
protected function setUp()
{
parent::setUp();
$this->container = $this->prophesize(ContainerInterface::class);
\Drupal::setContainer($this->container->reveal());
$this->typedDataManager = $this->prophesize(TypedDataManagerInterface::class);
$this->typedDataManager->getDefinition('field_item:boolean')->willReturn(['class' => BooleanItem::class]);
$this->container->get('typed_data_manager')->willReturn($this->typedDataManager->reveal());
$this->moduleHandler = $this->prophesize(ModuleHandlerInterface::class);
$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->keyValueFactory = $this->prophesize(KeyValueFactoryInterface::class);
$this->entityTypeManager = $this->prophesize(EntityTypeManagerInterface::class);
$this->entityTypeRepository = $this->prophesize(EntityTypeRepositoryInterface::class);
$this->entityTypeBundleInfo = $this->prophesize(EntityTypeBundleInfoInterface::class);
$this->entityDisplayRepository = $this->prophesize(EntityDisplayRepositoryInterface::class);
$this->entityFieldManager = new TestEntityFieldManager($this->entityTypeManager->reveal(), $this->entityTypeBundleInfo->reveal(), $this->entityDisplayRepository->reveal(), $this->typedDataManager->reveal(), $this->languageManager->reveal(), $this->keyValueFactory->reveal(), $this->moduleHandler->reveal(), $this->cacheBackend->reveal());
}
示例6: setUp
public function setUp()
{
$this->container = $this->prophesize(ContainerInterface::class);
$this->contentNavigationCollector = new ContentNavigationRegistry($this->container->reveal());
}