24 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
41 $mockFormRuntime = $this->getAccessibleMock(FormRuntime::class, [
42 'isAfterLastPage',
'processVariants'
45 $mockPage = $this->getAccessibleMock(Page::class, [
49 $mockFormState = $this->getAccessibleMock(FormState::class, [
53 $mockFormDefinition = $this->getAccessibleMock(FormDefinition::class, [
54 'getRendererClassName',
59 ->expects($this->any())
64 ->expects($this->any())
65 ->method(
'getRendererClassName')
69 ->expects($this->any())
70 ->method(
'getIdentifier')
71 ->willReturn(
'text-1');
74 ->expects($this->any())
75 ->method(
'isAfterLastPage')
79 ->expects($this->any())
80 ->method(
'processVariants')
83 $mockFormRuntime->_set(
'formState', $mockFormState);
84 $mockFormRuntime->_set(
'currentPage', $mockPage);
85 $mockFormRuntime->_set(
'formDefinition', $mockFormDefinition);
87 $this->expectException(RenderingException::class);
88 $this->expectExceptionCode(1326095912);
90 $mockFormRuntime->_call(
'render');
98 $objectManagerProphecy = $this->prophesize(ObjectManager::class);
99 GeneralUtility::setSingletonInstance(ObjectManager::class, $objectManagerProphecy->reveal());
101 $mockFormRuntime = $this->getAccessibleMock(FormRuntime::class, [
102 'isAfterLastPage',
'processVariants'
105 $mockPage = $this->getAccessibleMock(Page::class, [
109 $mockFormState = $this->getAccessibleMock(FormState::class, [
113 $mockFormDefinition = $this->getAccessibleMock(FormDefinition::class, [
114 'getRendererClassName',
119 ->expects($this->any())
124 ->expects($this->any())
125 ->method(
'getRendererClassName')
126 ->willReturn(
'fooRenderer');
129 ->expects($this->any())
130 ->method(
'getIdentifier')
131 ->willReturn(
'text-1');
134 ->expects($this->any())
135 ->method(
'isAfterLastPage')
139 ->expects($this->any())
140 ->method(
'processVariants')
143 $objectManagerProphecy
145 ->willReturn(
new \stdClass);
147 $mockFormRuntime->_set(
'formState', $mockFormState);
148 $mockFormRuntime->_set(
'currentPage', $mockPage);
149 $mockFormRuntime->_set(
'formDefinition', $mockFormDefinition);
150 $mockFormRuntime->_set(
'objectManager', $objectManagerProphecy->reveal());
152 $this->expectException(RenderingException::class);
153 $this->expectExceptionCode(1326096024);
155 $mockFormRuntime->_call(
'render');