public function getUnpublishedNodesDoesNotReturnInvalidNodes()
{
$mockContext = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
$expectedContextProperties = array('workspaceName' => $this->mockWorkspace->getName(), 'inaccessibleContentShown' => true, 'invisibleContentShown' => true, 'removedContentShown' => true, 'dimensions' => array());
$this->mockContextFactory->expects($this->any())->method('create')->with($expectedContextProperties)->will($this->returnValue($mockContext));
$mockNodeData1 = $this->getMockBuilder(NodeData::class)->disableOriginalConstructor()->getMock();
$mockNodeData2 = $this->getMockBuilder(NodeData::class)->disableOriginalConstructor()->getMock();
$mockNodeData1->expects($this->any())->method('getDimensionValues')->will($this->returnValue(array()));
$mockNodeData2->expects($this->any())->method('getDimensionValues')->will($this->returnValue(array()));
$mockNode1 = $this->getMockBuilder(NodeInterface::class)->getMock();
$mockNode1->expects($this->any())->method('getNodeData')->will($this->returnValue($mockNodeData1));
$mockNode1->expects($this->any())->method('getPath')->will($this->returnValue('/node1'));
$this->mockNodeFactory->expects($this->at(0))->method('createFromNodeData')->with($mockNodeData1, $mockContext)->will($this->returnValue($mockNode1));
$this->mockNodeFactory->expects($this->at(1))->method('createFromNodeData')->with($mockNodeData2, $mockContext)->will($this->returnValue(null));
$this->mockNodeDataRepository->expects($this->atLeastOnce())->method('findByWorkspace')->with($this->mockWorkspace)->will($this->returnValue(array($mockNodeData1, $mockNodeData2)));
$actualResult = $this->publishingService->getUnpublishedNodes($this->mockWorkspace);
$this->assertSame($actualResult, array($mockNode1));
}