public function setUp() { parent::setUp(); $this->contentTypeManager = $this->prophesize('Sulu\\Component\\Content\\ContentTypeManagerInterface'); $this->structureManager = $this->prophesize('Sulu\\Component\\Content\\Compat\\StructureManagerInterface'); $this->contentType = $this->prophesize('Sulu\\Component\\Content\\ContentTypeInterface'); $this->structureResolver = new StructureResolver($this->contentTypeManager->reveal(), $this->structureManager->reveal()); }
public function setUp() { parent::setUp(); $this->contentTypeManager = $this->prophesize(ContentTypeManagerInterface::class); $this->structureProperty = $this->prophesize(PropertyMetadata::class); $this->contentType = $this->prophesize(ContentTypeInterface::class); $this->propertyValue = $this->prophesize(PropertyValue::class); $this->legacyProperty = $this->prophesize(TranslatedProperty::class); $this->structureMetadata = $this->prophesize(StructureMetadata::class); $this->structure = $this->prophesize(Structure::class); $this->propertyFactory = $this->prophesize(LegacyPropertyFactory::class); $this->inspector = $this->prophesize(DocumentInspector::class); $this->subscriber = new StructureSubscriber($this->encoder->reveal(), $this->contentTypeManager->reveal(), $this->inspector->reveal(), $this->propertyFactory->reveal()); }
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()); }
public function setUp() { $this->contentTypeManager = $this->prophesize(ContentTypeManagerInterface::class); $this->node = $this->prophesize(NodeInterface::class); $this->structureMetadata = $this->prophesize(StructureMetadata::class); $this->document = $this->prophesize(StructureBehavior::class); $this->contentType = $this->prophesize(ContentTypeInterface::class); $this->encoder = $this->prophesize(PropertyEncoder::class); $this->propertyMetadata = $this->prophesize(PropertyMetadata::class); $this->propertyFactory = $this->prophesize(LegacyPropertyFactory::class); $this->inspector = $this->prophesize(DocumentInspector::class); $this->legacyProperty = $this->prophesize(PropertyInterface::class); $this->structure = new ManagedStructure($this->contentTypeManager->reveal(), $this->propertyFactory->reveal(), $this->inspector->reveal(), $this->document->reveal()); $this->inspector->getNode($this->document->reveal())->willReturn($this->node->reveal()); $this->inspector->getStructureMetadata($this->document->reveal())->willReturn($this->structureMetadata->reveal()); }