コード例 #1
0
 public function setUp()
 {
     $this->registry = $this->prophesize(DocumentRegistry::class);
     $this->subscriber = new RegistratorSubscriber($this->registry->reveal());
     $this->node = $this->prophesize(NodeInterface::class);
     $this->document = new \stdClass();
     $this->hydrateEvent = $this->prophesize(HydrateEvent::class);
     $this->persistEvent = $this->prophesize(PersistEvent::class);
     $this->removeEvent = $this->prophesize(RemoveEvent::class);
 }
コード例 #2
0
 public function setUp()
 {
     parent::setUp();
     $this->webspaceManager = $this->prophesize(WebspaceManagerInterface::class);
     $this->inspector = $this->prophesize(DocumentInspector::class);
     $this->registry = $this->prophesize(DocumentRegistry::class);
     $this->document = $this->prophesize(StructureBehavior::class)->willImplement(WebspaceBehavior::class);
     $this->webspace = $this->prophesize(Webspace::class);
     $this->localization1 = $this->prophesize(Localization::class);
     $this->localization2 = $this->prophesize(Localization::class);
     $this->subscriber = new FallbackLocalizationSubscriber($this->encoder->reveal(), $this->inspector->reveal(), $this->registry->reveal(), new LocalizationFinder($this->webspaceManager->reveal()));
     $this->hydrateEvent->getNode()->willReturn($this->node->reveal());
     $this->hydrateEvent->getDocument()->willReturn($this->document->reveal());
     $this->hydrateEvent->getLocale()->willReturn(self::FIX_LOCALE);
     $this->webspaceManager->findWebspaceByKey(self::FIX_WEBSPACE)->willReturn($this->webspace);
     $this->registry->getDefaultLocale()->willReturn('de');
 }