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


PHP NodeInterface::reveal方法代码示例

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


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

示例1: testLoadWithoutData

 public function testLoadWithoutData()
 {
     $content = [];
     $this->node->getPropertyValueWithDefault(Argument::any(), Argument::any())->will(function ($arguments) use(&$content) {
         if (isset($content[$arguments[0]])) {
             return $content[$arguments[0]];
         } else {
             return $arguments[1];
         }
     });
     $this->extension->setLanguageCode('de', 'i18n', null);
     $result = $this->extension->load($this->node->reveal(), 'default', 'de');
     $this->assertEquals(['title' => '', 'description' => '', 'keywords' => '', 'canonicalUrl' => '', 'noIndex' => false, 'noFollow' => false, 'hideInSitemap' => false], $result);
 }
开发者ID:ollietb,项目名称:sulu,代码行数:14,代码来源:SeoStructureExtensionTest.php

示例2: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->contentMapper = $this->prophesize('Sulu\\Component\\Content\\Mapper\\ContentMapperInterface');
     $this->requestAnalyzer = $this->prophesize('Sulu\\Component\\Webspace\\Analyzer\\RequestAnalyzerInterface');
     $this->contentTypeManager = $this->prophesize('Sulu\\Component\\Content\\ContentTypeManagerInterface');
     $this->structureManager = $this->prophesize('Sulu\\Component\\Content\\Compat\\StructureManagerInterface');
     $this->sessionManager = $this->prophesize('Sulu\\Component\\PHPCR\\SessionManager\\SessionManagerInterface');
     $this->session = $this->prophesize('PHPCR\\SessionInterface');
     $this->node = $this->prophesize('PHPCR\\NodeInterface');
     $this->parentNode = $this->prophesize('PHPCR\\NodeInterface');
     $this->startPageNode = $this->prophesize('PHPCR\\NodeInterface');
     $webspace = new Webspace();
     $webspace->setKey('sulu_test');
     $locale = new Localization();
     $locale->setCountry('us');
     $locale->setLanguage('en');
     $this->requestAnalyzer->getWebspace()->willReturn($webspace);
     $this->requestAnalyzer->getCurrentLocalization()->willReturn($locale);
     $this->contentTypeManager->get('text_line')->willReturn(new TextLine(''));
     $this->sessionManager->getSession()->willReturn($this->session->reveal());
     $this->sessionManager->getContentNode('sulu_test')->willReturn($this->startPageNode->reveal());
     $this->session->getNodeByIdentifier('123-123-123')->willReturn($this->node->reveal());
     $this->session->getNodeByIdentifier('321-321-321')->willReturn($this->parentNode->reveal());
     $this->node->getIdentifier()->willReturn('123-123-123');
     $this->node->getParent()->willReturn($this->parentNode->reveal());
     $this->node->getDepth()->willReturn(4);
     $this->parentNode->getIdentifier()->willReturn('321-321-321');
     $this->parentNode->getDepth()->willReturn(3);
     $this->startPageNode->getDepth()->willReturn(3);
     $this->structureResolver = new StructureResolver($this->contentTypeManager->reveal(), $this->structureManager->reveal());
 }
开发者ID:Silwereth,项目名称:sulu,代码行数:32,代码来源:ContentTwigExtensionTest.php

示例3: testHasValue

 public function testHasValue()
 {
     $type = new ContactSelectionContentType($this->template, $this->contactManager->reveal(), $this->accountManager->reveal(), $this->serializer->reveal(), new CustomerIdConverter(), new IndexComparator());
     $this->property->getName()->willReturn('test');
     $this->node->hasProperty('test')->willReturn(true);
     $this->assertTrue($type->hasValue($this->node->reveal(), $this->property->reveal(), $this->webspaceKey, $this->locale, $this->segmentKey));
 }
开发者ID:Silwereth,项目名称:sulu,代码行数:7,代码来源:ContactSelectionContentTypeTest.php

示例4: testHandleRegisterPersistAlreadyExists

 /**
  * It should not register on PERSIST when there is already a document.
  */
 public function testHandleRegisterPersistAlreadyExists()
 {
     $this->persistEvent->getDocument()->willReturn($this->document);
     $this->persistEvent->getNode()->willReturn($this->node->reveal());
     $this->persistEvent->getLocale()->willReturn('fr');
     $this->registry->registerDocument($this->document, $this->node->reveal(), 'fr')->shouldNotBeCalled();
     $this->registry->updateLocale($this->document, 'fr')->shouldBeCalled();
     $this->registry->hasDocument($this->document)->willReturn(true);
     $this->subscriber->handlePersist($this->persistEvent->reveal());
 }
开发者ID:hason,项目名称:sulu-document-manager,代码行数:13,代码来源:RegistratorSubscriberTest.php

示例5: testSetParentDocument

 /**
  * It should set the parent document.
  */
 public function testSetParentDocument()
 {
     $this->persistEvent->getDocument()->willReturn($this->document->reveal());
     $this->persistEvent->getLocale()->willReturn('fr');
     $this->metadataFactory->getMetadataForClass(get_class($this->document->reveal()))->willReturn($this->metadata->reveal());
     $this->metadata->getAlias()->willReturn('test');
     $this->nodeManager->createPath('/')->willReturn($this->parentNode->reveal());
     $this->persistEvent->hasParentNode()->shouldBeCalled();
     $this->persistEvent->setParentNode($this->parentNode->reveal())->shouldBeCalled();
     $this->documentManager->find('/test', 'fr')->willReturn($this->parentDocument);
     $this->subscriber->handlePersist($this->persistEvent->reveal());
 }
开发者ID:Silwereth,项目名称:sulu,代码行数:15,代码来源:StructureTypeFilingSubscriberTest.php

示例6: doGetProperty

 private function doGetProperty($name, $contentTypeName, $locale)
 {
     $this->propertyMetadata->getType()->willReturn($contentTypeName);
     $this->structureMetadata->getProperty($name)->willReturn($this->propertyMetadata);
     $this->contentTypeManager->get($contentTypeName)->willReturn($this->contentType->reveal());
     if ($locale) {
         $this->propertyFactory->createTranslatedProperty($this->propertyMetadata->reveal(), $locale, Argument::type(StructureBridge::class))->willReturn($this->legacyProperty->reveal());
     } else {
         $this->propertyFactory->createProperty($this->propertyMetadata->reveal(), $locale)->willReturn($this->legacyProperty->reveal());
     }
     $this->contentType->read($this->node->reveal(), $this->legacyProperty->reveal(), null, null, null)->shouldBeCalledTimes(1);
     $property = $this->structure->getProperty($name);
     $this->assertInstanceOf(PropertyValue::class, $property);
     $this->assertEquals($name, $property->getName());
 }
开发者ID:kriswillis,项目名称:sulu,代码行数:15,代码来源:ManagedStructureTest.php


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