public function setUp() { $this->convertUrisImplementation = $this->getAccessibleMock(ConvertUrisImplementation::class, array('tsValue'), array(), '', false); $this->mockWorkspace = $this->getMockBuilder(Workspace::class)->disableOriginalConstructor()->getMock(); $this->mockContext = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock(); $this->mockContext->expects($this->any())->method('getWorkspace')->will($this->returnValue($this->mockWorkspace)); $this->mockNode = $this->getMockBuilder(NodeInterface::class)->getMock(); $this->mockNode->expects($this->any())->method('getContext')->will($this->returnValue($this->mockContext)); $this->mockHttpUri = $this->getMockBuilder(Uri::class)->disableOriginalConstructor()->getMock(); $this->mockHttpUri->expects($this->any())->method('getHost')->will($this->returnValue('localhost')); $this->mockHttpRequest = $this->getMockBuilder(Request::class)->disableOriginalConstructor()->getMock(); $this->mockHttpRequest->expects($this->any())->method('getUri')->will($this->returnValue($this->mockHttpUri)); $this->mockActionRequest = $this->getMockBuilder(ActionRequest::class)->disableOriginalConstructor()->getMock(); $this->mockActionRequest->expects($this->any())->method('getHttpRequest')->will($this->returnValue($this->mockHttpRequest)); $this->mockControllerContext = $this->getMockBuilder(ControllerContext::class)->disableOriginalConstructor()->getMock(); $this->mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->mockActionRequest)); $this->mockLinkingService = $this->createMock(LinkingService::class); $this->convertUrisImplementation->_set('linkingService', $this->mockLinkingService); $this->mockTsRuntime = $this->getMockBuilder(Runtime::class)->disableOriginalConstructor()->getMock(); $this->mockTsRuntime->expects($this->any())->method('getControllerContext')->will($this->returnValue($this->mockControllerContext)); $this->convertUrisImplementation->_set('tsRuntime', $this->mockTsRuntime); }