40 $this->escapeInterceptor = $this->
getAccessibleMock(
'TYPO3\\CMS\\Fluid\\Core\\Parser\\Interceptor\\Escape', array(
'dummy'));
41 $this->mockViewHelper = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper');
42 $this->mockNode = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array(), array(),
'', FALSE);
43 $this->mockParsingState = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
51 $this->mockViewHelper->expects($this->once())->method(
'isEscapingInterceptorEnabled')->will($this->returnValue(TRUE));
52 $this->mockNode->expects($this->once())->method(
'getUninitializedViewHelper')->will($this->returnValue($this->mockViewHelper));
54 $this->assertTrue($this->escapeInterceptor->_get(
'interceptorEnabled'));
55 $this->escapeInterceptor->process($this->mockNode, $interceptorPosition, $this->mockParsingState);
56 $this->assertTrue($this->escapeInterceptor->_get(
'interceptorEnabled'));
64 $this->mockViewHelper->expects($this->once())->method(
'isEscapingInterceptorEnabled')->will($this->returnValue(FALSE));
65 $this->mockNode->expects($this->once())->method(
'getUninitializedViewHelper')->will($this->returnValue($this->mockViewHelper));
67 $this->assertTrue($this->escapeInterceptor->_get(
'interceptorEnabled'));
68 $this->escapeInterceptor->process($this->mockNode, $interceptorPosition, $this->mockParsingState);
69 $this->assertFalse($this->escapeInterceptor->_get(
'interceptorEnabled'));
78 $this->escapeInterceptor->_set(
'interceptorEnabled', FALSE);
79 $this->escapeInterceptor->_set(
'viewHelperNodesWhichDisableTheInterceptor', array($this->mockNode));
81 $this->escapeInterceptor->process($this->mockNode, $interceptorPosition, $this->mockParsingState);
82 $this->assertTrue($this->escapeInterceptor->_get(
'interceptorEnabled'));
90 $mockNode = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array(), array(),
'', FALSE);
91 $mockEscapeViewHelper = $this->getMock(
'TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\HtmlspecialcharsViewHelper');
92 $mockObjectManager = $this->getMock(
'TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
93 $mockObjectManager->expects($this->at(0))->method(
'get')->with(
'TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\HtmlspecialcharsViewHelper')->will($this->returnValue($mockEscapeViewHelper));
94 $mockObjectManager->expects($this->at(1))->method(
'get')->with(
'TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', $mockEscapeViewHelper, array(
'value' =>
$mockNode))->will($this->returnValue($this->mockNode));
95 $this->escapeInterceptor->_set(
'objectManager', $mockObjectManager);
97 $actualResult = $this->escapeInterceptor->process(
$mockNode, $interceptorPosition, $this->mockParsingState);
98 $this->assertSame($this->mockNode, $actualResult);
const INTERCEPT_CLOSING_VIEWHELPER
processWrapsCurrentViewHelperInHtmlspecialcharsViewHelperOnObjectAccessor()
const INTERCEPT_OPENING_VIEWHELPER
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
processDisablesEscapingInterceptorIfViewHelperDisablesIt()
const INTERCEPT_OBJECTACCESSOR
processReenablesEscapingInterceptorOnClosingViewHelperTagIfItWasDisabledBefore()
processDoesNotDisableEscapingInterceptorByDefault()