findShadowNodeByPath() public method

Find a shadow node by exact path
public findShadowNodeByPath ( string $path, Workspace $workspace, array $dimensions = null ) : NodeData | null
$path string
$workspace Neos\ContentRepository\Domain\Model\Workspace
$dimensions array
return Neos\ContentRepository\Domain\Model\NodeData | null
 /**
  * @test
  */
 public function nodeFromLiveWorkspaceMovedInUserWorkspaceRetainsShadowNodeInGroupWorkspace()
 {
     $liveContext = $this->contextFactory->create([]);
     $liveContext->getRootNode()->createNode('foo')->createNode('bar')->createNode('baz');
     $this->persistenceManager->persistAll();
     $this->rootNode->getNode('foo/bar/baz')->moveInto($this->rootNode->getNode('foo'));
     $this->persistenceManager->persistAll();
     $this->rootNode->getContext()->getWorkspace()->publish($this->groupWorkspace);
     $this->persistenceManager->persistAll();
     $groupContext = $this->contextFactory->create(['workspaceName' => $this->currentGroupWorkspace]);
     $movedBazNode = $groupContext->getRootNode()->getNode('foo')->getNode('baz');
     $this->assertInstanceOf(NodeInterface::class, $movedBazNode);
     $shadowNode = $this->nodeDataRepository->findShadowNodeByPath('/foo/bar/baz', $this->groupWorkspace, $groupContext->getDimensions());
     $this->assertInstanceOf(NodeData::class, $shadowNode);
     $this->assertNotNull($shadowNode->getMovedTo());
     $this->assertTrue($shadowNode->isRemoved());
 }