Neos\ContentRepository\Tests\Unit\Domain\Service\NodeServiceTest::cleanUpChildNodesNeverRemoveDocumentNode PHP Method

cleanUpChildNodesNeverRemoveDocumentNode() public method

    public function cleanUpChildNodesNeverRemoveDocumentNode()
    {
        $this->markTestSkipped('Currently this functionality is disabled. We will introduce it again at a later point and then reenable this test.');
        $nodeService = $this->createNodeService();
        $mockNode = $this->getMockBuilder(Node::class)->disableOriginalConstructor()->getMock();
        $mockNodeType = $this->mockNodeType('Neos.ContentRepository.Testing:Page');
        $mockContentNodeType = $this->mockNodeType('Neos.ContentRepository.Testing:Document');
        $mockFirstChildNode = $this->getMockBuilder(Node::class)->disableOriginalConstructor()->getMock();
        $mockFirstChildNode->expects($this->any())->method('getNodeType')->will($this->returnValue($mockContentNodeType));
        $mockFirstChildNode->expects($this->any())->method('getName')->will($this->returnValue('sidebar'));
        $mockFirstChildNode->expects($this->never())->method('remove');
        $mockMainChildNodeType = $this->mockNodeType('Neos.ContentRepository.Testing:ContentCollection');
        $mockNodeType->expects($this->once())->method('getAutoCreatedChildNodes')->will($this->returnValue(array('main' => $mockMainChildNodeType)));
        $mockNode->expects($this->once())->method('getNodeType')->will($this->returnValue($mockNodeType));
        $mockNode->expects($this->once())->method('getChildNodes')->will($this->returnValue(array($mockFirstChildNode)));
        $nodeService->cleanUpChildNodes($mockNode);
    }